code: function pauseStream(stream) {
      function _buffer(chunk) {
          stream.__buffered.push(chunk);
      }
  
      function _catchEnd(chunk) {
          stream.__imgapi_ended = true;
      }
  
      stream.__imgapi_ended = false;
      stream.__imgapi_paused = true;
      stream.__buffered = [];
      stream.on('data', _buffer);
      stream.once('end', _catchEnd);
      stream.pause();
  
      stream._resume = stream.resume;
      stream.resume = function _imgapi_resume() {
          if (!stream.__imgapi_paused)
              return;
  
          stream.removeListener('data', _buffer);
          stream.removeListener('end', _catchEnd);
  
          stream.__buffered.forEach(stream.emit.bind(stream, 'data'));
          stream.__buffered.length = 0;
  
          stream._resume();
          stream.resume = stream._resume;
  
          if (stream.__imgapi_ended)
              stream.emit('end');
      };
  }
docs: Note: Borrowed from muskie.git/lib/common.js. The hope is that this hack
  will no longer be necessary in node 0.10.x.
  
  This is so shitty...
  Node makes no guarantees it won't emit. Even if you call pause.
  So basically, we buffer whatever chunks it decides it wanted to
  throw at us. Later we go ahead and remove the listener we setup
  to buffer, and then re-emit.