To reach the answer to your question, it is necessary to take notice of the following points:
1 – The jurists have said: Offering prayers is makrooh (abominable) at certain places including "facing the picture or statue of living creatures, unless it is covered. It is makrooh to offer prayers at a place where there is a picture, even if it may not be placed in front of the person who offers prayers". Therefore, offering prayers at a place where there is the image of human and animate beings is abominable irrespective of whether the picture is in a mosque or elsewhere or whether it is in front of the people offering prayers or behind them. If there is a picture, it is better to cover the picture with something during prayers.
2- The jurists have also said about painting and decorating mosques with images of animate things:
Imam Khomeini (may his soul rest in peace): As an obligatory precaution, a mosque should not be decorated with gold and also with the pictures of things, which possess soul like human beings and animals. It is makrooh (abominable) to make paintings of things which do not possess soul such as a plant or a flower.
Grand Ayatollah Bahjat: A mosque should not, as an obligatory precaution, be decorated with gold and also with pictures of things especially those possessing soul like human beings and animals which are makrooh also in places other than a mosque and it is likely that offering prayers in such a mosque is makrooh. However, there is no objection in writing Quranic verses and authentic hadiths (on the walls) of a mosque.
Grand Ayatollah Fazel Lankarani: As a measure of precaution, a mosque should not be decorated with gold and also with pictures of things, which possess soul like human beings and animals. It is makrooh (abominable) to make paintings of things which do not possess soul like flowers and plants.
Grand Ayatollah Makarem Shirazi: There is problem in decorating a mosque with gold and, as a precaution, it should not be decorated with the pictures of things, which possess soul like human beings and animals.
Grand Ayatollah Sistani: The obligatory precaution is that a mosque should not be decorated with gold, and also, as a measure recommended precaution, it should not be decorated with the pictures of things, which possess soul like human beings and animals.
3- What is the Islamic law about hanging portraits and pictures in mosques?
In reply to a question about hanging pictures in mosques, Grand Ayatollah Khamenei has said: "There is no problem. However, if it (picture) is in a prayer hall, it is better to cover it with something."
What follows are examples of questions directed to Imam Khomeini (may his soul rest in peace) and answered by him:
1 – In His Eminence's Resalah (Treatise on Islamic Laws), paintings and images have been prohibited as an obligatory precaution. Does this prohibition include (framed) pictures also?
Answer: It does not include.
2- Now-a-days, we see pictures and posters hung up in front of people offering prayers in mosques or places where Friday Prayer is held. Is there any problem in the prayers offered in such places?
Answer: The prayers are in order, although they are makrooh in front of pictures. However, if they are covered with something, it will no longer be makrooh to offer prayers there.
3- Is it forbidden for a person to offer prayers with a picture of Makkah in front of him? What about pictures of places other than Makkah?
Answer: It is not haram and if there is a picture of an animate object, it is makrooh.
4- What is the Islamic law concerning martyrs' pictures hung up on the walls of the mosques?
Answer: There is no harm in it.-
 - Tauzihul Masail of Imam Khomeini (with connotation), vol.1, issue No.898.
 - Jame'ul Masail of Ayatollah Bahjat, vol.1, pg.547.
 - Tauzihul Masail (with connotation by Imam Khomeini) vol.1, issue No.908.
 - Tauzihul Masail (with connotation by Imam Khomeini) vol.1, pg.
509, Q No.375.
 - Istifta'at of Imam Khomeini (r.a), vol.1, pg.150, Q No.79, 80 and 81.
 - Istifta'at of Imam Khomeini (r.a), vol.3, pg.570, Q No.3.
 - Related indexes: The Islamic Law concerning pictures ascribed to the
mams, question 635.