bugfix: if there is no images can still generate pdf file