The Hadith to be considered is:
It was narrated that Jabir bin ‘Abdullah said: “The Messenger of Allah
(ﷺ) said: The best rows for men are the front rows and the worst rows
are the back rows, and the best rows for women are the back rows and
the worst are the front rows.”
So before a prayer starts, above is the recommended sequence.
I do believe that looking at the internal organs of a human, any other animal or living/non-living being is permissible for medical or educational purposes as this allows us to have a better understanding of the human anatomy. However it is best to use an animal as a muslim after death should really be buried. But I'm not a scholar.