Optimizing image resizing.