Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: "When a man raises his head before the imam, how can he be safe from his head being turned into the head of a dog? Those people who raise their gazes towards the sky (in prayer) must certainly stop, or else their sight will not be returned to them."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9143