I think in depicting the story, artists were more concerned in showing the pregnant figure than to be accurate. Elizabeth was already 6 month pregnant when Mary came to visit. If I recall, Mary stayed 3 months. It is a beautiful and touching story.
Without actually stating it (6+3), Luke and the Spirit strongly imply Mary stayed until Elizabeth’s babe was born. Mary needed to see that it was born alive and indeed was male pursuant to the angels’ prophecies, in order to confirm Gabriel’s prophecy to her.