Add endian feature to image maker and do some tidy up.