Hello,
Hallucinations occur in the state between waking and sleeping. You may be having hypnopompic hallucinations. Hypnopompia occurs upon waking, and may also be accompanied by sleep paralysis. It may be a direct result of alcohol or drug use, or could be due to insomnia, anxiety, stress or other factors. Try relaxation techniques before bedtime to help the mind shut down. You can also indulge in meditation and yoga.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
I don't know about side effects of your sleep medication, but it could be part of the problem. Carefully read about side effects for whatever you are taking.