refactored extension API, added image module
merging refactored internal API
merging refactored internal API