code: function(arg, callback) {
              var imageObj, canvas;
  
              // if arg is null or undefined
              if(!arg) {
                  callback(null);
              }
  
              // if arg is already an image object
              else if(this._isElement(arg)) {
                  callback(arg);
              }
  
              // if arg is a string, then it's a data url
              else if(this._isString(arg)) {
                  imageObj = new Kinetic.window.Image();
                  imageObj.onload = function() {
                      callback(imageObj);
                  };
                  imageObj.src = arg;
              }
  
              //if arg is an object that contains the data property, it's an image object
              else if(arg.data) {
                  canvas = Kinetic.Util.createCanvasElement();
                  canvas.width = arg.width;
                  canvas.height = arg.height;
                  var _context = canvas.getContext(CONTEXT_2D);
                  _context.putImageData(arg, 0, 0);
                  this._getImage(canvas.toDataURL(), callback);
              }
              else {
                  callback(null);
              }
          }
docs: /*
  arg can be an image object or image data