I don't believe that having these thoughts are indicative of wanting to harm your baby. Please keep in mind that your body has undergone tremendous hormonal changes over the past year, as well as the psychological impact of caring for a completely helpless baby.
I had these disturbing thoughts at random times with my first child, and again with my second. Yes, they scared me. But I always rationalized that in fact, no, I did not subconsciously want harm my child. I figured it was due to the incredible responsibility I had. Babies are so vulnerable, so helpless, and there is so much that can go wrong. SIDS, unprotected electrical plugs, dangling blind cords, harmful cleaning products left under the sink, etc. Every time we turn around, we are bombarded with the dangers that lurk around each corner awaiting our precious babies. And then there are the darker dangers...dangerous people.
We want to protect our babies, and the mind "prepares" itself by suggesting disturbing scenarious. I've also heard that the mind does this during other times of stress as well {imagining a plane crash before boarding a flight, for example}.
I would think, too, that if you have any OCD tendencies, that could also exasperate the thoughts and images. Try relaxing, meditating, and consciously countering these disturbances with deliberate positive ones of kissing, snuggling, and loving your baby.
These thoughts will eventually subside, I promise. Until then, be gentle with yourself.