title: Jquery upload function doesn't work for multiple images on 1 page
body: <p><strong>How it works:</strong>
  I'm trying to create an instant upload function with Jquery/Ajax. When a user double-clicks an image, a Fancybox shows up with the upload field. After choosing an image, the image is uploaded and the source of the clicked image is changed immediately.</p>
  
  <p><strong>The problem:</strong>
  When having multiple images on one page, sometimes another image gets replaced by the new image (randomly).</p>
  
  <p><strong>The code:</strong></p>
  
  <pre><code>function uploader(thumb) {
  new AjaxUpload('imageUpload', {
      action: 'uploader.php',
      name: 'file',
      onComplete: function(file, response) {
          thumb.attr('src', response);
          $.fancybox.close();
      }
  });
  }
  
  $("img").dblclick(function(){
      var img = $(this);
      $.fancybox({
          href: '#imageUpload',
          overlayShow: true
      });
      uploader(img);
      return false;
  });
  </code></pre>
  
  <p><strong>What I've tried:</strong>
  When I alert the ID of the image that should be replaced, it always alerts the correct ID of the image. And still it replaces another image instead.</p>
  
  <p>Regards,
  Bo</p>