                            :width width
                            :height height
                            :mimetype mimetype
-                           :collection (uuid/from-string (:id params))
+                           :collection collection
                            :name filename
                            :path (str path)}))
 

;; --- Create image

(s/def ::create-image
  (s/keys :req-un [::file ::width ::height ::mimetype] :opt-un [::us/id]))

(defn create-image
  [{user :identity params :route-params  data :data}]
  (let [{:keys [file id width height mimetype] :as data} (us/conform ::create-image data)
        id (or id (uuid/random))
        filename (paths/base-name file)
        storage media/images-storage]

(s/def ::file ::us/uploaded-file)
(s/def ::width ::us/integer-string)
(s/def ::height ::us/integer-string)
(s/def ::collection (s/nilable ::us/uuid-string))
(s/def ::mimetype string?)

(def +thumbnail-options+ {:src :path
