Reworked identifyImage to be a bit more bearable