According to a fascinating post on the PSYCHE-D list, recent MRI studies hint that mental images are generated or at least processed by the same brain structures which process real-world image data from the retina:
[There is] some evidence to suggest that our memories are amodal abstractions whose modality can only be returned by reprocessing through the perceptual apparatus. Colour is in the eye of the beholder; by which I mean that the greenness of a green field can only be perceived by a conscious onlooker; the qualia of greenness isn’t a property of the grass. Colour is only perceived as such when it flows though the visual colour area […]. The same is true of our memories: only by pumping our memories through V4 do [we] experience the colour content implicitly coded in our memories. Reality is achromatic; memories are achromatic. The occipital lobe isn’t a sensory cortex; it is perceptual. It can accept inputs either from the retina or from the temporal lobes. From these inputs it produces the conscious sensation of vision.
If true, this suggests that the whole visual perception system can in effect operate backwards, from consciousness out. [c.f Empedocles, elliptically]