code: private URI getImageFile(final URI href) {
          final URI fileName;
          final FileInfo fi = job.getFileInfo(currentFile.resolve(href));
          if (fi != null) {
              fileName = job.getInputDir().relativize(fi.src);
          } else {
              fileName = href;
          }
  
          final URI outputURI = outputDir.toURI().resolve(fileName);
          if (exists(outputURI)) {
              logger.debug("Found " + outputURI);
              return outputURI;
          }
  
          final URI tempURI = job.tempDirURI.resolve(fileName);
          if (exists(tempURI)) {
              logger.debug("Found " + tempURI);
              return tempURI;
          }
  
          if (fi != null) {
              final URI srcTempURI = job.tempDirURI.resolve(fi.uri);
              if (exists(srcTempURI)) {
                  logger.debug("Found " + srcTempURI);
                  return srcTempURI;
              }
          }
  
          final URI srcURI = job.getInputDir().resolve(fileName);
          if (exists(srcURI)) {
              logger.debug("Found " + srcURI);
              return srcURI;
          }
  
          return null;
      }
docs: TODO create a list of files and list of directories, then check permutations for hits