Ayesha reported,

Umm Habiba and Umm Salama mentioned to the Messenger of Allah ﷺ a church they had seen in Abyssinia which contained images.The Messenger of Allah ﷺ said, "When a righteous man among those people died, they would build a place of worship over his grave and place these images in it. Those are the worst of creation before Allah on the Day of Resurrection."

Muslim 1181

Sahih

و حدثني زهير بن حرب حدثنا يحيى بن سعيد حدثنا هشام أخبرني أبي

عن عائشة

أن أم حبيبة وأم سلمة ذكرتا كنيسة رأينها بالحبشة فيها تصاوير لرسول الله ﷺ فقال رسول الله ﷺ إن أولئك إذا كان فيهم الرجل الصالح فمات بنوا على قبره مسجدا وصوروا فيه تلك الصور أولئك شرار الخلق عند الله يوم القيامة

مسلم 1181صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Prohibition of building mosques over graves, placing images in them, and taking graves as mosques
Numbering
Darussalam 1181
Muslim 1181