Fixed #181. Although the detector is not automatically deleted when all its images have been removed, now it checks if there is any image and if there is not, it sends an error message.