Praise be to Allah.
The scholars are unanimously agreed that it is not allowed to pray in a place in which there are images of animate beings. In fact some of them were of the view that doing so is haraam, although the view of the majority is that it is makrooh.
Imam al-Nawawi (may Allah have mercy on him) said:
As for fabric on which there are images or crossed lines or anything that distracts the worshipper, it is makrooh to pray in it, facing towards it or on it.
End quote from al-Majmoo‘, 3/185
Shaykh al-Islam Ibn Tayimiyah (may Allah have mercy on him) said:
The correct view, which was narrated from ‘Umar ibn al-Khattaab and others, and is mentioned in reports from Ahmad and others, is that if there are images in it (the church), he should not pray there, because the angels do not enter the room in which there are images, and because the Prophet (blessings and peace of Allah be upon him) did not enter the Ka‘bah until the images that were in it had been erased. This is what ‘Umar said: We would not enter their churches if there were images in them.
End quote from Majmoo‘ al-Fataawa, 22/162
Al-Bahooti al-Hanbali (may Allah have mercy on him) said:
It is makrooh to pray facing towards a set-up image, as was stated, because it is similar to the kuffaar’s prostrating to them (images). … In al-Fusool it says: It is makrooh to pray facing a wall on which there are pictures and images, because that is similar to the worship of idols and statues.
End quote from Kashshaaf al-Qinaa‘, 1/370
The scholars of the Standing Committee said:
Praying in a place in which there is an image in front of the ones who are praying is resembling the worshippers of idols, and there are many hadeeths which indicate that it is forbidden to resemble the enemies of Allah and that we are enjoined to differ from them. It should also be noted that putting pictures of animate beings on walls is something that is not permissible; rather it is something that leads to exaggeration and shirk, especially if they are images of people who are venerated.
End quote from Fataawa al-Lajnah al-Daa’imah, 6/250-251.
‘Abd al-‘Azeez ibn Baaz, ‘Abd al-Razzaaq ‘Afeefi, ‘Abd-Allah ibn Ghadyaan, ‘Abd-Allah ibn Qa‘ood
The later Hanafi and Shaafa‘i scholars – unlike the Hanbalis – were so strict that they even forbade praying in a place in which there are any images, even if they are behind the one who is praying or placed on the ground so that he cannot see them.
Al-Shibramalsi al-Shaafa‘i said:
It is makrooh to pray in a garment on which there is an image, or on a cloth on which there is an image, even if one is blind or it is dark, or the image is behind his back or placed face downwards on the ground so that he cannot see it when he prays on it (the cloth). This is clear, so as to keep away from the image which is forbidden.
End quote from Haashiyat Nihaayat al-Muhtaaj, 2/14
See also the answer to question no. 130263
From the comments quoted above we may find out and understand the wisdom behind not allowing prayer in a place in which there are images and statues. These reasons are:
The angels do not enter a room where there is an image. It was narrated from Abu Talhah (may Allah be pleased with him) that the Prophet (blessings and peace of Allah be upon him) said: “The angels do not enter a room in which there is a dog or an image.”
Narrated by al-Bukhaari, 3225; Muslim, 2106.
The worshipper is asking Allah to send down mercy and increase blessings; how could you ask for that in a place where the angels of mercy will not enter?
Avoiding any resemblance to those who worship idols and statues, namely the idolaters, or even the Christians, who fill their churches with images of Christ and his mother Mary (peace be upon them) on the basis of falsehood. Avoiding any imitations of the non-Muslims is one of the important teachings of sharee‘ah, so as to prevent the identity of the Muslims from being assimilated and lost, and so as to preserve its bright light which shines forth among the nations.
It was narrated from ‘Aa’ishah that Umm Habeebah and Umm Salamah mentioned a church that they had seen in Abyssinia in which there were images, to the Messenger of Allaah (blessings and peace of Allah be upon him). The Messenger of Allaah (blessings and peace of Allah be upon him) said: “Those people, if there was a righteous man among them and he died, they would build a place of worship over his grave and put those images in it. They will be the most evil of mankind before Allaah on the Day of Resurrection.”
Narrated by al-Bukhaari, 427; Muslim, 528
Avoiding that which may distract the worshipper. If an image is in front of one who is praying, it may distract him and cause his mind to wander, when the Muslim should seek to attain the highest degree of focus and humility when standing before Allah, may He be exalted, in his prayer.
It was narrated that Anas (may Allah be pleased with him) said: ‘Aa’ishah had a patterned curtain with which she covered the side of her house. The Prophet (blessings and peace of Allah be upon him) said: “Take this patterned curtain of yours away from us because its images kept distracting me in my prayer.”
Narrated by al-Bukhaari, 374, in Bab Kiraahiyyat al-salaah fil tasaaweer.
See also the answer to question number 161211.
And Allah knows best.