Beginnings of the image generator.

This still needs to be refactored a lot. As it is, the build method is getting longer than I'd like with no end in sight, and the class has too many methods for my taste. Perhaps splitting it up into multiple classes would be better.