changed image size to scale by ratio