All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is not permissible to look at the 'Awrah of a man or a woman as the Prophet said: “Cover your ‘Awrah, except from your wife or what your right hand possesses. One of the Companions asked, “O Messenger of Allah, what if one of us is alone?” He said, “Allah has more right that we be shy of Him than people.” [Ahmad and others, Al-Albaani graded it as Hasan (good)]
Looking at the picture has the same ruling as looking at the real ‘Awrah.
Ibn al-Qattaan al-Faassi said in his book, Ihkaam an-Nadhar fi Ahkaam an-Nadhar:
“All that we said: that it is not permissible for a man or others to look at the A’wrah or at a person, then it is not permissible to look at his reflection such as a mirror, or water, or a glittering or polished material (that reflects the image)….” [End of quote]
This is as long as there is no necessity or a dire need. If there is a necessity or a dire need for looking at the 'Awrah, then looking at the 'Awrah of the same sex is less serious than looking at the 'Awrah of the opposite sex; so a woman looks at the 'Awrah of a woman, and a man looks at the 'Awrah of a man. Necessity or a dire need should be valued according to its proper value.
Therefore, one should be careful and not be lenient about this in a way that the student looks at what he/she does not need, as that is one of the greatest causes of affliction. Indeed, it is due to the affliction that looking is forbidden.
Ibn ‘Abideen said in his footnote of Rad al-Muhtaar:
“Looking is forbidden due to the fear of affliction and desire (lust).”
Allah knows best.