Thinking about those things (accidentally) is a sign of Iman!
Rasool Allah Salla Allahu Alaihi Wa Sallam one time got asked by some sahaba: (rough translation) "We have found in our hearts extremely evil thoughts." and he said (S.A.A.S) "Those thoughts are a sign of Iman"
You're fine as long as you don't believe them and go by them!