v0.2.4: fixed img.onload not calling resolve by implementing btoa in pdfimage.