Rewrote imdecode as manual function to work with Node::Buffer