Replace embedded imamges from HTML and add figure directory