fix finishEmbedImage bug