Rescale images and fix image with empty space