The answer is fairly simple, and the problem is in your original premise, or rather your understanding of reality. When perceiving reality, i.e. external stimuli, the brain is doing the same thing as it is when you are in a dream, perceiving "reality" in the dream. A way of looking at it is that we are always "dreaming" but when we are awake the dreams are bound by external stimuli and when we are sleep, due to sensory deprivation, your brain is able to perceive things freely. So, that is why you still have an imagination/mind's eye when still in a dream, because cognition/perception/the state of being aware is the same whether you are awake or asleep.