just thought I'd throw this in too - I get flashing lights about half an hour before I get a migraine - I dont know if youve ever had one?
Whatever it is I hope it gets better soon!
I was going to reply to suggest migraine as well. I'd had migraines on and off my whole life but never with aura (i.e. seeing stuff). when i was about 28 weeks i started to see the flashing lights and then have a migraine a few hours later. maybe worth mentioning to your gp too?

I also hope you're feeling better soon too.

Tish
xx