title: Remove files from queue on add
body: <p>I'm using blueimp's file uploader. I want to make it so that users can only upload a single file (I can't use <code>maxNumberOfFiles</code> because I'm not using the UI plugin). </p>
  
  <p>How can I make it so that when the user selects a new image to upload, it removes the file that was previously in the queue, and then adds the new image file into the queue for upload?</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>$('#fileupload').fileupload({
      dataType: 'json',
      add: function(e, data) {
          var uploadErrors = [];
          var acceptFileTypes = /^image\/(gif|jpe?g|png)$/i;
  
          if (data.originalFiles[0]['type'].length &amp;&amp; !acceptFileTypes.test(data.originalFiles[0]['type'])) {
              uploadErrors.push('Invalid file type.');
          } else if (data.originalFiles[0]['size'] &gt; 1000000) {
              uploadErrors.push('Image over size.');
          }
  
          if (uploadErrors.length &gt; 0) {
              $('.errors').html(uploadErrors);
          } else {
              data.submit();
          }                    
      },
      progressall: function (e, data) {
          var progress = parseInt(data.loaded / data.total * 100, 10);
          $('.progress .bar').css('width', progress + '%');
      }
  });
  </code></pre>