Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: "Whoever among you raises his head in prayer before the imam, how can he feel safe from his head being turned into the head of a dog? And 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المعجم الكبير للطبراني / باب العين / 9142