title: fabric.js on node.js failure applying filter
body: <p>Using 
  canvas.loadFromJSON(json, function(){</p>
  
  <p>I get the following error if the image has a filter applied.</p>
  
  <p>The error appears to be at/around ln 19484, i wrapped in a try catch block to and did console.log('element to draw' +elementToDraw.toString())  and console.log('ctx'+ctx.toString()) to see if the elements exist</p>
  
  <pre><code>      elementToDraw &amp;&amp; ctx.drawImage(elementToDraw,
                                   x + imageMargins.marginX,
                                   y + imageMargins.marginY,
                                   imageMargins.width,
                                   imageMargins.height
                                  );
  
  
      element to draw[object Image]
  ctx[object CanvasRenderingContext2D]
  TypeError: Image or Canvas expected
      at TypeError (native)
      at klass._render (fabric.js:19486:28)
      at klass.drawObject (fabric.js:13079:12)
      at klass.render (fabric.js:13016:14)
      at klass._renderObjects (fabric.js:7091:34)
      at klass.renderCanvas (fabric.js:7069:12)
      at klass.renderAll (fabric.js:9019:12)
      at fabric.js:11619:15
      at cbIfLoaded (fabric.js:11646:21)
      at klass.__setBgOverlay (fabric.js:11668:19)
  json loaded
  </code></pre>
  
  <p>The fabric object is generated client side and then uploaded to the server where Fabric 1.7.22 is running under node . I tested with 1.5.0, 1.6.0, and 1.7.22 and all three show no difference.  </p>
  
  <p>The server is running node v6.12.3</p>
  
  <p>When I run on the command line:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var fs = require('fs'),
      fabric = require('fabric').fabric,
      out = fs.createWriteStream(__dirname + '/helloworld.png');
  
  var canvas = fabric.createCanvasForNode(400, 400);
  try{
   var src = __dirname + '/client_318-CL-Tatnall_4x3_art.png';
   fs.readFile(src, function(erro, data) {
    if (erro) console.log(erro);  
    fabric.Image.fromURL(src, function (img) { 
     img.src = src;
     img.filters.push( new fabric.Image.filters.Sepia());
     img.filters.push(new fabric.Image.filters.Grayscale());
     
     img.crossOrigin = "anonymous";  
     img.width = canvas.width;
     img.height = canvas.height;
     console.log(img);
  
     try{
      img.applyFilters(); 
      canvas.add(img)
  
     } catch(err){
      console.log(err);
     }
    var stream = canvas.createPNGStream();
    stream.on('data', function(chunk) {
      out.write(chunk);
    });
  
    return;
    }, {crossOrigin: "anonymous"});
    return;
   });
  
  } catch(err){
   console.log(err); 
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I get the same error</p>