             (let [type (:type collection)
                   id (:id collection)]
               (rs/emit! (di/select-collection type id))))]
-    (let [images (count (:images collection))]
+    (let [images (count (:images collection []))]
       [:li {:on-click on-click
             :class-name (when selected? "current")}
        [:span.element-title (:name collection)]

     [:span (:name image)]]))

(mx/defc grid
  {:mixins [mx/static]}
  [state selected {:keys [id type images] :as coll}]
  (let [own? (= type :own)
        ordering (:order state)
        filtering (:filter state)
        images (->> images
                    (remove nil?)
                    (filter-images-by filtering)
                    (sort-images-by ordering))]
    [:div.dashboard-grid-content


(mx/defc nav-section
  {:mixins [mx/static mx/reactive]}
  [type selected colls]
  (let [own? (= type :own)
        builtin? (= type :builtin)
        collections (cond->> (vals colls)
                      own? (filter #(= :own (:type %)))
                      builtin? (filter #(= :builtin (:type %)))
                      own? (sort-by :id))]
