Insert PDFExId into images. Fix template bug drawing images.