Image functionality ported from pdf.js
function getImages() {
    var images = this.internal.collections[namespace + 'images']; //first run, so initialise stuff

    if (!images) {
      this.internal.collections[namespace + 'images'] = images = {};
      this.internal.events.subscribe('putResources', putResourcesCallback);
      this.internal.events.subscribe('putXobjectDict', putXObjectsDictCallback);
    }

    return images;
  }