The Prophet ﷺ entered the House and found inside it an image of Ibrahim and an image of Maryam. He said, "Have they not heard," and in another version, "Have these people not heard," and likewise in Ahmad (2508), "that the angels do not enter a house in which there is an image? Here is Ibrahim depicted in an image. What is he doing casting lots with arrows?"
دخل النبي ﷺ البيت فوجد فيه صورة إبراهيم وصورة مريم. فقال: أما لهم- وفي نسخة: أما هم، وكذا عند أحمد (٢٥٠٨)- فقد سمعوا أن الملائكة لا تدخل بيتا فيه صورة، هذا إبراهيم مصور، فما له يستقسم؟
Bukhari narrated it in the chapters on the Prophets (3351), from Yahya bin Sulayman, who said, Ibn Wahb narrated to me, Amr informed me that Bukayr told him, on the authority of Kurayb, the freed slave of Ibn Abbas, from Ibn Abbas, and he related it.His statement, "Have they not indeed heard" means from the teachings of the earlier prophets, so how did they dare to place these images in the Kaaba. Al-istiqsam means seeking a portion by lot. Their practice of istiqsam with the arrows was that when one of them intended to travel, marry, or do something similar, he would cast the divining arrows. Some of the arrows had written on them, "My Lord has commanded me," and on another, "My Lord has forbidden me," and on another, nothing at all. If the one that came out read, "My Lord has commanded me," he proceeded with his matter, and if it read, "My Lord has forbidden me," he held back, and if the blank one came out, he would shuffle them and cast them again. So the meaning of istiqsam is seeking what has been allotted to one through what has not been allotted. The azlam are the divining arrows and shafts with which they used to seek these portions.