Changed scope of get_image_id