Fix scroll jank when closing an image preview