All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
It seems that you are merely suffering from waswaas (obsessive whisperings) and the evil work of the devil. You should disregard such whisperings and carry on with your prayer without paying any attention to them until Allaah relieves you of this burden.
Even if we assume that you pray while holding back gas, your prayer is valid. Therefore, there is no reason for your worries.
Allaah knows best.