added appendPDF function
allow appendImage to use base64 image data as well as a url