implement "add_image_index" correctly