[refcnt] Fix embedded image building