code: 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;
    }
docs: Image functionality ported from pdf.js