I'm a horrible person

I have lost 3 babies in the last four years - a very good friend had a baby within the last year and is three months along with another they announced it at like 4weeks gone - just the overconfidence hurt me, they were so sure that it'd all go perfectly yet whenever I've conceived I've been petrified almost not even wanting to tell my own dh because I know how it hurts when it doesn't stick :(
These people are amazing - fantastic parents too - but when they went for their three month scan last week I thought in my head for a split second that something might not be right with the pregnancy and that would teach them for being so sure of themselves! (The scan was absolutely fine by the way)
It's terrible to think that I know. I can't stop thinking that I thought that - I've prayed over and over since, that everything will be okay because they deserve it as much as I do or anyone ttc does but I feel so guilty about it. If anything was to happen I would never forgive myself!
I also feel that maybe I don't deserve to have children because of my awful thought :( I just hope beyond hopes that the pregnancy continues smoothly xx and that I can learn to forgive myself for my awful thought 
Sorry if my post has offended anyone