         console.warn 'ignoring (new) type', type
 
 
-isImg = (url) -> url?.match /\.(png|jpg|gif|svg)$/i
-
-loadImages = (conv_id, cont) ->
+# these are images that are single segments that we detect as being
+# images (not attachments).
+loadInlineImages = (cont) ->
     for seg, i in cont?.segment ? []
         href = seg?.link_data?.link_target
-        if isImg(href) and !seg.link_data.img
-            seg.link_data.img = imgel = document.createElement 'img'
-            imgel.src = href
-            imgel.onload = (ev) ->
-                return unless typeof img.naturalWidth == 'number'
-                action 'imgload', conv_id
+        if isImg(href) and !seg.link_data.imgel
+            preload seg.link_data, href

ifpass = (t, f) -> if t then f else pass

format = (cont) ->
    if cont?.attachment?.length
        try
          formatAttachment cont.attachment
        catch e

                                mclz = ['message']
                                mclz.push 'placeholder' if e.placeholder
                                div id:e.event_id, key:e.event_id, class:mclz.join(' '), ->
                                    content = e.chat_message?.message_content
                                    format content
                                    loadInlineImages content
    if lastConv != conv_id
        lastConv = conv_id
        later atTopIfSmall
