;(function($, global, $multifile)
{
  if ( !global.FileReader )
    return;

  $multifile.templateCb = function(file)
  {
    var $tmpl = $('<p class="uploaded_image"> \
      <a href="" class="multifile_remove_input">x</a> \
      <span class="filename"></span> \
      <img class="multifile_preview" /> \
    </p>')
      , fr = new FileReader();
    $tmpl.find('span.filename').text(file.name);
    fr.onload = $multifile.fileReaderCb($tmpl, file);
    fr.readAsDataURL(file);
    return $tmpl;
  };

  $multifile.image_filter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\/x\-xwindowdump)$/i;

  $multifile.fileReaderCb = function($tmpl, file_obj)
  {
    return function(event)
    {
      if ( $multifile.image_filter.test(file_obj.type) )
        $tmpl.find('img.multifile_preview')
          .attr('src', event.target.result);
    };
  };

})(jQuery, this, $.fn.multifile);

@@ -15,17 +15,16 @@
 global, 
-$
 multifil
@@ -28,11 +28,75 @@
 file
-)%0A%7B
+_plugin)%0A%7B%0A  var _parent_templateCb = multifile_plugin.templateCb;%0A
 %0A  i
@@ -131,25 +131,24 @@
  return;%0A%0A  
-$
 multifile.te
@@ -144,16 +144,23 @@
 ultifile
+_plugin
 .templat
@@ -192,378 +192,70 @@
     
-var $tmpl = $('%3Cp class=%22uploaded_image%22%3E %5C%0A      %3Ca href=%22%22 class=%22multifile_remove_input%22%3Ex%3C/a%3E %5C%0A      %3Cspan class=%22filename%22%3E%3C/span%3E %5C%0A      %3Cimg class=%22multifile_preview%22 /%3E %5C%0A    %3C/p%3E')%0A      , fr = new FileReader();%0A    $tmpl.find('span.filename').text(file.name);%0A    fr.onload = $multifile.fileReaderCb($tmpl, file);%0A    fr.readAsDataURL(file);%0A    return $tmpl
+return multifile_plugin.fileReaderCb(_parent_templateCb, file)
 ;%0A  
@@ -256,25 +256,24 @@
 e);%0A  %7D;%0A%0A  
-$
 multifile.im
@@ -261,32 +261,39 @@
  %7D;%0A%0A  multifile
+_plugin
 .image_filter = 
@@ -674,17 +674,16 @@
 $/i;%0A%0A  
-$
 multifil
@@ -683,16 +683,23 @@
 ultifile
+_plugin
 .fileRea
@@ -719,23 +719,24 @@
 ion(
-$
 t
+e
 mpl
+ateCb
 , file
-_obj
 )%0A  
@@ -741,22 +741,104 @@
   %7B%0A    
-return
+var fr = new FileReader()%0A      , $tmpl = templateCb(file)%0A      , $img;%0A    fr.onload =
  functio
@@ -863,17 +863,16 @@
    if ( 
-$
 multifil
@@ -872,16 +872,23 @@
 ultifile
+_plugin
 .image_f
@@ -906,12 +906,8 @@
 file
-_obj
 .typ
@@ -921,26 +921,65 @@
     
-  $tmpl.find
+%7B%0A        $img = $
 ('
+%3C
 img
-.
+ /%3E').attr(%7B%0A          'class': '
 mult
@@ -992,17 +992,17 @@
 preview'
-)
+,
 %0A       
@@ -1008,20 +1008,14 @@
     
-.attr(
 'src'
-,
+:
  eve
@@ -1034,16 +1034,110 @@
 sult
-);%0A    %7D
+%0A          %7D);%0A        $tmpl.append($img);%0A      %7D%0A    %7D;%0A    fr.readAsDataURL(file);%0A    return $tmpl
 ;%0A  

make preview plugin more extensible by wrapping the templateCb instead of overriding it.