Image functionality ported from pdf.js
function generateAliasFromImageData(imageData) {
    if (typeof imageData === 'string') {
      return jsPDFAPI.sHashCode(imageData);
    }

    if (jsPDFAPI.isArrayBufferView(imageData)) {
      return jsPDFAPI.sHashCode(jsPDFAPI.arrayBufferToBinaryString(imageData));
    }

    return null;
  }