Improvements to buildImage and better Javadoc comments