       for part in parts {
         if part.name == "imageJson" {
           switch (part.body) {
+          case .json(let jsonDoc):
+            imageJson  = jsonDoc
           case .text(let stringJson):
             let encoding = String.Encoding.utf8
             if let dataJson = stringJson.data(using: encoding, allowLossyConversion: false) {

   */
  func updateImageJSON(json: JSON, withRequest request: RouterRequest) throws -> JSON {
    var updatedJson = json
    guard let authContext = request.userInfo["mcaAuthContext"] as? AuthorizationContext, 
              let contentType = ContentType.sharedInstance.getContentType(forFileName: updatedJson["fileName"].stringValue) else {
      throw ProcessingError.Image("Invalid image document!")
    }

import Dispatch

enum BluePicLocalizedError : LocalizedError {

    case getTagsFailed
    case noImagesByTag(String)
    case getAllImagesFailed
