You were very close. Those hallucinations were the beginnings of a dream. Next time this happens, try to follow your thoughts until they coalesce into a dream scene If you worry it is not happening on its own, you can help yourself along by visualizing a scene of your own. Make it something that engages your senses, and it will take over and become your new reality.