Fixed NPE when recognizing text with Tesseract.