resize if image is too large