OK, the very first eyespots were on single cell organisms for photosenthesis. Would the simple eyespot distinguish between sunlight and moonlight? Do we have theories as to how they developed in predators? As the eye developed, the brain would have to develop as well so that it could process even rudimentary images, correct?
A simple eyespot probably does not detect moonlight. Light would have to have a certain minimum energy to interact with the photoreactive pigments in the eyespot. Also, the eyespot probably senses light centered around a specific wavelength.
The likely mechanism of the evolution of eyes has been pieced together by the examination of primitive eyes in current living species. Some species have light-sensitive patches of cells, while others have formed an indentation filled with light-sensitive cells. Because the indentation provides some protection to the light sensitive cells, the individuals with indented eye patches would tend to live longer and reproduce more. Over time (thousands of generations), the indentation becomes deeper and finally becomes a pit. A pit covered with translucent skin protects the light sensing cells better than an open pit. A lens would concentrate light, and probably developed from a thickening in the translucent eye skin. All of these eye variations currently exist. It is not necessary to have a brain to process rudimentary visual information--I'm pretty sure that scallops, with their hundreds of eyes, do not have a brain. In animals that have highly acute vision, the brain and eye probably became more complex simultaneously.
An interesting aside: I read about a man who was blind from birth, whose sight was restored by a novel kind of surgery when he was an adult. Because he had never had the kind of visual stimulation that infants and children get very early (while their brains are still malleable), he never learned to process the images. He could not see some optical illusions--like the ones where parallel lines appear slanted, he saw as parallel. And he could learn to recognize shapes and colors, but never learned to recognize faces. After spending most of his life blind, he continued to use non-visual clues to recognize people.