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, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
The basic principle is that it is prohibited to keep pictures of living beings appearing in complete form. However, if they are used in a manner by which they are disrespected, such as on carpets and the like, then there is no harm in that. The Kuwaiti Encyclopedia of Fiqh reads, “...But if the image is not treated with respect, then there is no harm in that according to the majority of the scholars, such as the case with images on the ground like carpets (spread out on the floor) or mattresses and the like.”
However, the mosques should be preserved against having such images on carpets or the like. The Kuwaiti Encyclopedia reads:
“Places of worship should be respected by not having such images (of living beings) inside them. Some scholars held that it is disliked to perform prayer in the presence of an image, even if it is next to the praying person, behind him, or in the place of his prostration. Mosques should be spared what is disliked just as they should be spared what is prohibited. It was narrated that when the Prophet, sallallaahu ʻalayhi wa sallam, saw the images inside the Kaʻbah, he did not enter it until they were erased.”
As for the ruling on performing prayers on carpets bearing prohibited images, scholars held different opinions as to whether it is disliked or allowed. There is no famous view that holds that it is prohibited to perform prayer on such carpets or that the prayer is invalid. The Kuwaiti Encyclopedia reads:
“Scholars unanimously maintained that whoever prays while there is a prohibited image of an animal in the Qiblah (the direction he is facing in prayer), then he has done a disliked deed, because it is similar to the disbelievers' prostrating to their idols, even if the praying person does not intend imitating the disbelievers in this regard. However, if the image is not in the direction of the Qiblah, such as on the carpet for instance, then scholars held different views in this case.
The Hanafis held that it is disliked to perform prayer in a garment bearing images of living beings, or with such a garment over his head, in front of him, next to him to his right or left or where he prostrates. They (Hanafi scholars) held different views pertaining to the ruling of having an image behind him; the most likely correct view is that it is disliked. It is not disliked if the image is under his feet or where he sits as long as he does not prostrate on it or that it is in his hand or is small in size because small statues are not worshiped and are not considered idols in this case.
The Shaafiʻis maintained that it is disliked to perform prayer in a garment bearing images of living beings, perform prayer on it, or pray while facing it.
The Hanbalis held that it is not disliked to perform prostration over what even bears an image, and it was disliked by Sheikh Ibn Taymiyyah. The author of Al-Furoo' said, “It is not disliked, because he is not considered to be praying towards it.” [Abridged]
In brief, it is not prohibited to perform prayer on carpets bearing images, and the prayer is not declared invalid. However, it is advisable that the Muslim avoids doing this to evade the prohibition of using images of living beings and honoring them. Moreover, the worshiper should keenly avoid whatever may distract him during the prayer and affect his khushoo’ (submission, humility and absolute concentration). For more benefit, please refer to fatwa 88834.
Allaah knows best.