                           :size [300 110]
                           :quality 92
                           :format "jpg"})
+
+(def populate-thumbnails
+  #(images/populate-thumbnails % +thumbnail-options+))
+
+(def populate-urls
+  #(images/populate-urls % media/images-storage :path :url))
 
 ;; --- Create Collection
 


;; --- List collections

(defn list-images
  [{user :identity route-params :route-params}]
  (let [params {:collection (uuid/from-string (:id route-params))
                :user user
                :type :list-images}
        thumbnail-opts +thumbnail-options+
        populate-thumbnails-url #(images/populate-thumbnails % thumbnail-opts)]
    (->> (sv/query params)
         (p/map #(http/ok (rsp (map populate-thumbnails-url %)))))))

                           :name filename
                           :path (str path)}))

            (create-response [entry]
              (let [loc (str "/api/library/images/" (:id entry))]
                (http/created loc (rsp entry))))]
      (->> (st/save storage filename file)
           (p/mapcat persist-image-entry)
           (p/map populate-thumbnails)
