Changed TeX export to use figures, to keep the text with the images