When you saw her picture, it may have triggered an intense desire in you to be with her. Though you haven’t spoken to her in months, this kind of effect is still very possible.
You already liked her to begin with. Now that it has been months since you spoke to her, it can be quite easy to forget the reason why you stopped speaking to her in the first place.
This is often what time does. We tend to forget certain details. Instead, we may focus on how good that person that we liked made us feel whenever we were around them in the past.
That may have been the emotion that was triggered when you saw her picture. This is even more likely if the picture showed her in a very attractive light.
You can’t stop thinking about and obsessing over her because those old feelings have returned and time has washed away whatever negative experiences you may or may not have had with her in the past.
In essence, everything seems so fresh and new again as though you have just met her for the first time.