Refactor.
Add embed image support for OS X.