fixing image resizing issue