code: function resize(url, type) {
    var img = new Image();
    display.innerHTML = '';
    img.onload= function () {
      var data = resizeImage.resize(img, 200, 100, type);
      var smallImg = new Image();
      display.appendChild(smallImg);
      smallImg.src = data;
    };
    display.appendChild(img);
    img.src = url;
  }
docs: resize an <img> to 200*100