Image resizing improvements