Resize the output image to specified size