Removed hacky trick to get the image width and height