Visual inspection with optical endoscopes