The last time I can think of this coming up in fiction was in the atrocious Wild Wild West movie. They solve a murder by shining a light through a dead man's head to reveal the last thing he saw. Don't watch the movie, just watch this clip. This is the commonly understood idea of how it might work, and it's wrong, but it is most definitely a man's head.
What you're asking about is optography, the idea that the eye records the last image before death. While there was a lot of quackery that you could get it by simply photographing a dead person's eyes, you can't, there is some scientific basis to this.
Under ideal circumstances it has produced information... from rabbits. Wilhelm Kühne in 1878 claimed some success, though it's hard to separate his results from wishful thinking. When there was any success it required special preparation. The rabbit's eyes had to be covered to allow a build up of rhodopsin, they were made to stare at a high contrast target for minutes, and their eyeballs were quickly sliced and put into a solution. The process is analogous to fixing a photographic negative.
Here's Kühne's own notes on one experiment.
An albino rabbit, after being kept 15 min. in the dark, was decapitated; one eye was removed from the head under sodium light...and fastened onto the edge of a cork by means of needles...[The eye was placed in a] dark chamber with the cornea pressing softly against the diaphragm. The image was visible on the sclerotic, on one side of the optic nerve...that I was sure that it fell on the more deeply coloured division of the retina and could readily mark its place in the appropriate quadrant. Thereupon the yellow curtain was removed from the pane and the eye after five minutes' exposure was taken away, divided along the equator and examined in feeble gaslight....I brought the preparation out into darkened daylight and shewed it to several witnesses. There was evident on the retina a most distinct brighter diffused spot, the small dimension of which corresponded to those of the image previously seen by me, and the position of which made me already sure that it was the optogram.
The lack of a double-blind in his experiments (ie. Kühne knew what the rabbit was looking at when it died) means Kühne's own sketches of what he claimed to have seen in the rabbit's eyes could have been influenced by what he already knew the rabbit had seen.
This was never successfully performed on humans, though not for lack of trying. Optography as a forensic technique was re-evalutaed in the 1970s. While they were able to reproduce some of the results on specially prepared rabbits with high-contrast images, their conclusion about its use for forensics was...
If any, the scientific importance and benefit of optography is rated as minimal today. Historical considerations of using optography as a forensic instrument have never been realized.