Fixed the image encoding bug by skipping the image embed function