Thought of something else to help you.
The mind works a lot like your eyes; you may have a whole field of vision (thought) but you can only give complete focus to one thing at a time. Often when trying to avoid a particular thought, it is the one that keeps coming up.
Try this exercise to learn greater control of your mental focus:
Think of a fruit - today I will use an orange. Visualize it in as much detail as you can. See the dimples in the skin, and how the light shines off of it in some spots, while other sections appear matte. Notice the butt of the stem near the top, and the dark green color of it. Now pick it up in your dominant hand. Feel the dimples that you saw a moment ago. Trace your fingertip around it, feel the soft, slightly rubbery texture. Now toss it in the air and catch it in your other hand, feeling the gentle weight as it lands. Use your thumbnail to begin prying the peel off the flesh, and notice the spray of juice as it tears. The scent of citrus comes on strong and sharp. Peel about half of it, and notice if the skin still hangs connected or if it is detached entirely. See the fibrous white underside of the peel, and run your finger along that, noticing the difference in texture. Pull a slice of the orange out and eat it. Notice the taste, the texture of the slice, the scents, the sounds as you eat it. Engage every sense in as much detail as you can. When you have explored this orange fully, set it back down.
Now for the second half of the exercise, avoid thinking about oranges. Do not picture the color of the fruit. Do not remember that gentle weight as you tossed it from one hand to the other. Do not imagine breaking the skin with your thumbnail and smelling citrus. Do not imagine tearing a slice free and tasting it.
Makes it a little difficult, right? Instead what you should be doing is choosing an object to focus on that has absolutely nothing to do with oranges. Try imagining a cat or dog or bathtub instead, and apply that same level of detail to it as you did in the initial exercise.
This is the lesson here - when you are trying to avoid a certain thought or image, trying to specifically avoid it will likely make it pop up again and again. Instead, focus on something else in immaculate detail.
If you wish to gain greater control of your intrusive thoughts, this can be used to train your mind not to react. Each morning as you start your day, choose an object and examine it mentally in detail. Then set yourself a trigger reminder throughout the day - a well placed note, elastic band on your wrist, or intermittent alarms on your phone. Whenever this triggers, remember to not think of your object. Absorb yourself completely in something else. Over time this will develop your focus and these intrusive thoughts will happen less often, and in a less invasive manner.