Only resize image if it exceeds max image size