code: function(width, height) {
  									var newImage = svgCanvas.addSvgElementFromJson({
  										element: 'image',
  										attr: {
  											x: 0,
  											y: 0,
  											width: width,
  											height: height,
  											id: svgCanvas.getNextId(),
  											style: 'pointer-events:inherit'
  										}
  									});
  									svgCanvas.setHref(newImage, e.target.result);
  									svgCanvas.selectOnly([newImage]);
  									svgCanvas.alignSelectedElements('m', 'page');
  									svgCanvas.alignSelectedElements('c', 'page');
  									updateContextPanel();
  								}
docs: let's insert the new image until we know its dimensions