I can't recommend strongly enough this book: https://www.amazon.com/How-Resist-Temptation-Francis-Remler/dp/1928832393
Even if you're not Catholic, this book is worth your time because it dispels many common misunderstandings about temptation and sin.
Try to be at peace. Many thoughts occur to us spontaneously. That means that these thoughts are not representative of who you are. Simply having a thought enter into your consciousness, however vile it may be, is never a sin, because sin always involves a choice.
I can't recommend the book How To Resist Temptation strongly enough. Fr. Remler breaks down the process of temptation so that we can know where temptation ends and sin begins.
All temptation begins with an idea being presented to your mind. No matter how bad the thought is, it is not a sin for something to simply occur to you.
Next, we perceive the pleasure we would experience if we were to cooperate with the thought. Something like, "It would be such a rush to steal that purse!" Here also, there is no sin. Temptations would hold no power over us if they didn't offer some perceived good for us to reach out and take.
For undisciplined minds, these first two steps might last several minutes, like an idle daydream. However, at some point you will come to the third step, where you become aware of your thoughts and the opportunity to act on them or not. At this point, sin is possible. If you choose to dwell on those thoughts, if you choose to continue thinking about how good it would be to give in to temptation, or (obviously) if you fully cooperate with the thought and act it out, now you are culpable for the sin.
Many people who don't understand this process are confused and think they have sinned when they have only been in steps 1 and 2. Fr. Remler says that the proper response to temptation is to calmly and resolutely say no, and go about one's business. In other words, don't be anxious about the fact that you experience temptation. Tempting thoughts (even the same thought) may occur to you several times in the span of a minute, but this doesn't mean that there is anything wrong with you. It means you are temporarily being bothered by something like a pesky housefly. Keep shooing the thoughts away, turn your mind to prayer, and eventually it will leave.
You have not committed the sin of blasphemy, because any sin requires intent. We have unbidden thoughts, good and bad, important and trivial, all the time. That's just the way our minds work. What matters is how we respond to these thoughts.
So how should we respond to an unpleasant or inappropriate thought? First, be at peace. In his book, How to Resist Temptation, Fr. Remler compared such thoughts to a pesky housefly: annoying, but not dangerous. When they bother us, we should dismiss them and carry on about our business.
Second, know that you are not alone in experiencing this. You may simply be experiencing (intrusive thoughts)[https://en.wikipedia.org/wiki/Intrusive_thought].
Are you asking whether being tempted is a mortal sin? Temptation is only sinful if at least one of the following is true:
the temptation is willful (that is, you intentionally do something that you know might cause you to be tempted, and you have no sufficiently good reason for doing so)
you consent to the temptation. This doesn't necessarily mean actually doing the act that you are tempted to do: entertaining the idea is enough.
It can be extremely tricky (maybe even impossible) to determine whether a specific sin is mortal or venial, especially when you are trying to figure out whether your culpability is reduced because of habit. And it's probably not a good idea to spend too much time worrying about it (I know... easier said than done), because you don't want to focus your attention on impure thoughts and ideas any more than you have to. That said, it sounds to me like "letting this perception ... overtake your mind" is consent, so my advice would be to refrain from receiving Communion until you've gone to Confession - or at least until you have spoken with a priest about your concerns.
If you are open to reading material, How to Resist Temptation is really good. It was recommended in another thread a while back, and I've found it really helpful: it talks about how to distinguish between temptation and sin (and how to figure out when temptation is/becomes sinful), as well as different types of temptation and how to avoid or deal with them.