Check for null width or height before checking for a smaller image.