I believe on first click the popup is loading before the image is completely downloaded, so it does not know the size to use for positioning. Therefore, the top-left corner is centered.
If you know the image size ahead of time, you could pre-size the IMG tag in the popup via CSS
If you don't have too many images on the page, you could try pre-loading them
You could also add a small setTimeout delay on the popup to allow the image download to complete:
$(document).on("pageshow", function () {
$('.image_link').on('click', function (event) {
$("#show_image_img").attr("src", "http://www.aai.ee/planets/nineplanets/gif/SmallWorlds.jpg");
setTimeout(OpenPopup, 50);
});
});
function OpenPopup(){
$("#show_image").popup({ positionTo: "window" }).popup('open');
}