added tesseract functions to capture and remove unneeded files