<div id="upload-container">
  <script type="text/javascript" src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>

  <script>
    django.jQuery( document ).ready(function() {
      django.jQuery("#{{ name }}").change(function(){
        django.jQuery('.loadimages').html("");
        django.jQuery.map(django.jQuery("#{{ name }}").get(0).files, function(file) {
          django.jQuery(".loadimages").val(window.loadImage(
            file,
            function (img) { django.jQuery('.loadimages').append(img); },
            {maxWidth: 120, maxHeight: 120, canvas: true, noRevoke: true}
          ));
        })
      });
    });
  </script>

  <style>
    .loadimages canvas, .loadimages img { padding: 10px; }
  </style>

  <input type="file" name="{{ name }}" value="{{ value }}" id="{{ name }}" {% if not value %}multiple{% endif %} />
  <div class="loadimages" style="height:{% if not value %}260px; overflow:auto;{% else %}130px;{% endif %} background: #F8F8F8;">
    {% if value %}<img width="120" height="120" src="{{ value }}" id="imageExample" />{% endif %}
  </div>

</div>
