Although there are seldom people have this problems. But it should not be eye diseases or some eye problems. I searched online and i find some people called it as Entoptic phenomenon. That is to say, an image is caused by the eye itself. One theory is that your eyes receive light mechanically when you open your eyes. When you close your eyes, the pressure of your eyelids closing stimulates the cells of the retina to perceive light though light is not there.
So far, there is not a ton of research done into the phenomena because it not bother most of people. Besides, this is not an diseases or some vision problems. But there are some people believed the tiny moving dots when you close your eyes is result of a function of persistence-of-vision. It is said that the light travels at 186,000 miles per second, however, the reaction that occurs from eye to brain is slower. So, you can see tiny moving dots when close eyes.