code: function rotateImage(contentType, imgBuf, callback) {
      try {
          new Jimp(imgBuf, function (err, image) {
              if (err) {
                  console.log('Image loading error: ' + err);
                  callback(imgBuf);
              } else {
                  image.rotate(180)
                  .getBuffer(contentType, function (err, rotated) {
                      if (err) {
                          console.log('Image processing error: ' + err);
                          callback(imgBuf);
                      } else {
                          callback(rotated);
                      }
                  });
              }
          });
      } catch (err) {
          /*
            Sometimes Jimp throws instead of passing error via the callback as it should.
            Sigh. e.g: "Image loading error: Error: Unsupported interlace method"
           */
          console.log('Jimp threw an error: ' + err);
          callback(imgBuf);
      }
  }
docs: /*
  Rotate an image passed in imgBuf and pass a Buffer with the result  to 'callback'. If
  there are any problems, just return the original buffer unmodified.
  
  Preserves the content type (png, jpeg, bmp) of the original image.