I sort of get how you got to imagine your new baby.
When I was pregnant I kept imagining my new baby as a boy. Call it mother's intuition or just a random fluke of the brain.
The difference is that I realised immediately it was silly and that it could cause problems, so I forced myself to think of the future child as a girl instead.
It turns out it was a boy. Again, intutition or fluke. Who knows?
The point is that you can't control your fellings as they emerge, but I do think you can nurture them or counterbalance them.
I'm really sorry you're feeling this way, but you did allow yourself to get involved in a fantasy world for you that could laid the ground for disappointment.
What you can do NOW, is to encourage good feelings and good fantasies of having a girl instead of delving in the loss of your fantasy. It was only just that, a fantasy.
It's like mourning someone dear. You can allow yourself to keep that person constantly in your mind or you can move on and look to the future.
Take some time to notice little girls around you, focus on the good points of being a girl, start imagining yourself with that girl.
Hopefully, your feelings will change.
If necessary have some counselling. Just don't allow your child to ever feel she wasn't wanted.