Changing to checking naturalWidth of the image, to have less code