Fix image resizing for thumbnail