Add images to pdf, but has bugs