Adapted the image capturer so that it accepts a working directory as parameter