updated image resizing