"You can't prevent the birds from flying over your head, but you can prevent them from building a nest in your hair." (source unknown)
What matters is not the nature of the thoughts, but what you do with them. Similarly, God doesn't judge you as sinful simply because you see or hear of sinful...