fix last image in detection