Tell those voices that keep telling you all the "what-ifs" to go sit in a corner, like a naughty child, that you'll deal with them later. Say it aloud as it usually disrupts the thoughts.
The last thing anyone should ever do is think about what could happen when riding, because that's what will likely happen. I forget what it's called, but there is an actual name for that sort of thing. I've had some scary falls and close calls, as recent as the other day... but you gotta push it out of your head and focus on what you're doing.
The way I see it, I could be killed crossing the street by a drunk driver or even killed by a falling meteorite. Yes, there are real risks in riding but there are risks in everything you do. When I'm riding and especially jumping, I go full throttle because I know that one time I second guess myself and hold back I will probably mess up and get hurt.
Everyone who has fallen and been banged up thinks back to that moment at some point in their riding career. You'll play the situation through your head a million times and wonder what you could have done differently and in a lot of cases there isn't anything you could have done to prevent it. Sometimes, horses spook for no obvious reason and sometimes you're going to get thrown and maybe even seriously hurt. It's just riding.
I think the OP obviously needs to build her confidence back up but at the same point they should still be exposed to spooky horses to get a better sense of how to handle them. I was a fairly timid rider until I switched barns and was put on super high strung horses - all fired up OTTB's! You learn how to sense when they are about to spook and more importantly you learn how to stay on and handle the situation which will give you tons of confidence to make you a better rider.
(Also don't forget to breath, it will help relax you. Some people will also tell you to sing in your head when you're nervous or even count along to their gait. Like 1 2 1 2 and so forth, just anything to get you distracted and before you know it, you won't need to do any of those things and your nervousness will disappear!)