/**
  * Previews an image
  *
  * @param string $width
  * @param string $height
  * @return string
  */
 public function previewImage($width = '', $height = '')
 {
     try {
         //User must be logged in
         if (!$this->auth->check()) {
             //Raise error
             throw new Exception('You must login', 401);
         }
         //Return image as data-url encoded string
         echo json_encode(['error' => false, 'data' => $this->imageHandler->previewUploaded($_FILES['profile_picture']['tmp_name'], $width, $height)]);
     } catch (Exception $e) {
         //Unexpected error
         echo json_encode(['error' => true, 'data' => null, 'message' => $e->getMessage()]);
     }
 }