Sahih al-Bukhari, Book 10, Hadith 86 (Bukhari 674)

Narrated Abu Huraira:

The Prophet (ﷺ) said, "Isn't he who raises his head before the Imam afraid that Allah may transform his head into that of a donkey or his figure (face) into that of a donkey?"