Nodejs, serving a constant image

I am trying to load an image file in node.js. The file will be in ram and loaded outside of the main loop. Its just a 1x1 pixel.

How do I open an image file?

I tried the below:

var fs = require('fs');
fs.readFile('/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/pixel1x1.gif', function(err,pixel){
  if(err) {
    console.error("Could not open file: %s", err);
    process.exit(1);
  }
  console.log(pixel);
});


Server running at http://127.0.0.1:8124/
<Buffer 47 49 46 38 39 61 01 00 01 00 80 00 00 00 00 00 ff ff ff 21 f9 04 01 00 00 00 00 2c 00 00 00 00 01 00 01 00 00 02 01 44 00 3b>

Image could not be display because it contains errors.

 res.writeHead(200, {'Content-Type': 'image/gif'});
 res.end(pixel);