Hypnogogic imagery is what is seen when a person is falling asleep, but there is also hypnopompic imagery... and I hope I spelled that right. It's imagery that can stick with someone when they're waking up, so it's possible that this is what you were experiencing.

http://en.wikipedia.org/wiki/Hypnopompic_imagery