Fix image resizing issue