You might consider diatoms https://en.wikipedia.org/wiki/Diatom which have the ability to deposit silicon dioxide in their cell walls. They can be transparent, or have structural coloration due to refraction of light. Extend that ability to deposit SiO2 to multi-cellular creatures, and you can have them evolve quartz lenses, prisms, and perhaps even mirrors, all of which form the basis of human optics.
So your SiO2-depositing* creature can capture and focus light. Now all you need is some sort of sensor that works in vacuum. Now since your organism already manipulates SiO2, it isn't stretching credibility to imaging that it could evolve something like a CCD or CMOS sensor, as used in digital cameras.
*Note that I'm not suggesting silicon-based life here, just ordinary carbon-based life that can also manipulate SiO2 at the nanoscale.