Fix image_extent test to handle OOM errors