Help?

I'm dating my boyfriend of almost seven months, however my past keeps catching up on me. My ex and mine relationship was abusive, sexually and emotionally and I cant help it as it replays through my mind forcing me to stop mid intercourse. It honestly makes me feel horrible and I even struggle walking around the school sometimes knowing I may run into him. It's stupid I know because we dont even make contact anymore, but hes a dangerous person and I cant help it as thoughts (bad ones) slip up in my mind.. I do try so hard to remember my boyfriend is not my ex but I really cant help it.. I feel horrible for it. Any tips? Anything?