I have these types of thoughts all of the time. I've had OCD my entire life and I am not in medication. I recently had a major battle with unwanted, intrusive and disturbing thoughts brought in by a book I had been reading. I tried to skip over the violent content but it was too late, I had already read the first few sentences before i realized where it was going.
My thoughts are always about violence perpetrated to children or animals and not by me, but by stories of cruelty on the news, etc. I never fear I would do any of these things but what others have done, whether real or made up, constantly play over and over in my head. The imagery is extremely disturbing.
The last time I grappled with this, a few days ago, it was a living hell to be in my mind. It is so difficult to make this type of thing stop. I keep reminding myself its just thoughts, they aren't real, they aren't happening and my sick mind is just tormenting me. If I ignore it will go away but the more I try to avoid the thought, the more persist ant it gets so I found a rather unique way of combating them but I have no idea how well it would work for others. I know it is not an instant fix, even for me, I have to try it a few times before it kicks in but it eventually does.
Here is what I do. I do not try to stop the disturbing thought. Running away from it doesn't work, it makes it worse. Sort of like "forbidden fruit" and your mind will rebel against you more. I let them come but I develop a "twist" to them. For example, the child in my thoughts can not be harmed because every time my mind plays a scene where violence will befall the child or animal, they either dematerialize or can not be captured, thereby defusing the thought process and the imagery can not continue to play out. Maybe the abusers hands suddenly disappear or they fall through a trap door. I know it sounds weird but it works, that's the craziest part of it. It actually works. Once you play the twist thought several times in your head, whenever the intrusive thought tries to occur, it magically disappears. The thought comes less and less because it has lost its grip on you. Its intended purpose of shocking or disturbing you has been eliminated.
This also works if you imagine a big giant stop sign in your head every time the thought tries to emerge but I find its more difficult to do for persist ant ones. Its better to let them play out and twist them.