fixed missing figures when template is Rmd