Some fixes and clean up.

* Remove CACHE_IMAGE.
* Add md5sum to clean build.
* Fix CUSTOM_BUILD.