image builder along with some refactorings in extractor.js