So, how is it possible to prevent these ugly thoughts from appearing and flooding one's mind? The best thing to start with is to start communicating your feelings with your partner. It is important to ask them why they have chosen especially you and also tell them openly that you love them. You may want to explain also that because they are so important to you, you are feeling jealous and insecure about that one other person you think might be a potential "third party". There is a great chance that your partner will reassure you of the fact that he/she is in a relationship with you because of feelings for you only and not as a "stand-in" until someone better comes along.
Never feel in a negative way about yourself and certainly do not talk negatively about yourself. (I'm talking about BOTH your concerns) Self confidence is always respected by others and if you constantly keep thinking about positive things when negative feelings start invading you, a habit of doing so will eventually erase the negative thoughts altogether.
I hope this helps.
Don't worry, kay?