You should preload image and on the load event of image get its height and width
$('.p_photo_image').click(function () {
//just get the thumb
//image src and put it in the preview image src
var clicked_image = $(this).attr('src');
//Preload image
var img = new Image();
img.src = clicked_image;
img.onload = function () {
alert("height: " + this.height + " width:" + this.width);
$('#preview_pic').attr('src', this.src);
};
})