Topic: Order images after loading from server

First question here and I apologize in advance if my research wasnt thorough enough.

I am using PLupload to retrieve images from my server which it does fine, my problem is showing them in the order in which they were uploaded. The image order while retrieving is important as it is a fundamental part of the application.

Here is my code so far to retrieve:

ready: function() {
  plupload = $("#uploader").plupload('getUploader');    
  var files = new Array();
  $.get('data/funcs/retrieve.php', function(data) {
    <?php foreach($images as $key => $val){ ?>
      files.push('<?php echo $val; ?>');
    <?php } ?>

    files.forEach(function(entry) {
        var img = new mOxie.Image();
        var url = o.resolveUrl(entry);
            img.onload = function() {
                plupload.addFile(img.getAsBlob());
            } //end image onload
        img.load(url);
    });
    
}); 

Any help will be greatly appreciated.