         .write tmpFile.path, (err) ->
           if err
             tmpFile.unlink()
+            err.payload = payload
             return callback err
           out.send tmpFile.path
           do callback

        out.send payload
        do callback
        return

  c

    chunk.then (buffer) ->
      type = fileType buffer
      unless type
        err = new Error 'Unsupported MIME type'
        err.payload = payload
        return callback err
      if type.ext is 'gif'
        tmpFile = new temporary.File
        gm payload
