Sayyiduna Abdullah bin Zayd (may Allah be pleased with him) says that a complaint was made to the Prophet (peace and blessings be upon him) about a man who imagines something (passing wind) during prayer. He (peace and blessings be upon him) said: "He should not turn away from his prayer until he hears a sound or finds a smell."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 749
(a) It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you feels wind in his stomach and is unsure whether it has come out or not, he should not leave until he hears its sound or finds a smell."
(b) Suhayl bin Abi Salih says: He should not leave the mosque.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 750
(c) It is narrated from al-Hasan (may Allah have mercy on him) that when you sense that you may have broken your ablution but are certain of your ablution, then you are still in a state of ablution; and when you are in doubt about your ablution but are certain of having broken it, then perform ablution.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 751