prevent images from getting bigger than original image