Calculate automatically width and height of an image if is not specified

Hi, i've added a small check that calculate automatically the height and width of an image if are not specified data-image-w or data-image-h.

Hope it helps.