async function processUserImages(files) {
  files = Array.from(files);
  let backgroundImages = [];

  files.forEach((file) => {
    // Add file filter

    let promise = new Promise((resolve, reject) => {
      let reader = new FileReader();
      reader.readAsDataURL(file);
      reader.addEventListener("load", () => {
        let image = new Image();
        image.src = reader.result;
        image.addEventListener("load", () => {
          image = new BackgroundImage(
            image.src,
            {imgWidth: image.width, imgHeight: image.height},
            {userName: "You", userProfile: "https://www.youtube.com/watch?v=OzL7u5teZhg"}
          );
          resolve(image);
        });
        image.addEventListener("error", () => {
          reject(Error("Unable to load image"));
        });
      });
    });
    backgroundImages.push(promise);
  });
  return await Promise.all(backgroundImages);
}
/**
 * Process the files provided by the user and returns an array of BackgroundImages
 * @function processUserImages
 * @param {Array<Blob>} files Array of files provided by the user
 * @returns {Promise<Array<BackgroundImage>>}
 */
Process the files provided by the user and returns an array of BackgroundImages
@function processUserImages
@param {Array} files Array of files provided by the user
@returns {Promise>}
Process the files provided by the user and returns an array of BackgroundImages @function processUserImages @param { Array } files Array of files provided by the user @returns { Promise > }
async function processUserImages(files) {
  files = Array.from(files);
  let backgroundImages = [];
  files.forEach((file) => {
    let promise = new Promise((resolve, reject) => {
      let reader = new FileReader();
      reader.readAsDataURL(file);
      reader.addEventListener("load", () => {
        let image = new Image();
        image.src = reader.result;
        image.addEventListener("load", () => {
          image = new BackgroundImage(
            image.src,
            {imgWidth: image.width, imgHeight: image.height},
            {userName: "You", userProfile: "https://www.youtube.com/watch?v=OzL7u5teZhg"}
          );
          resolve(image);
        });
        image.addEventListener("error", () => {
          reject(Error("Unable to load image"));
        });
      });
    });
    backgroundImages.push(promise);
  });
  return await Promise.all(backgroundImages);
}
async function processUserImages ( files ) { files = Array . from ( files ) ; let backgroundImages = [ ] ; files . forEach ( ( file ) => { let promise = new Promise ( ( resolve , reject ) => { let reader = new FileReader ( ) ; reader . readAsDataURL ( file ) ; reader . addEventListener ( "load" , ( ) => { let image = new Image ( ) ; image . src = reader . result ; image . addEventListener ( "load" , ( ) => { image = new BackgroundImage ( image . src , { imgWidth : image . width , imgHeight : image . height } , { userName : "You" , userProfile : "https://www.youtube.com/watch?v=OzL7u5teZhg" } ) ; resolve ( image ) ; } ) ; image . addEventListener ( "error" , ( ) => { reject ( Error ( "Unable to load image" ) ) ; } ) ; } ) ; } ) ; backgroundImages . push ( promise ) ; } ) ; return await Promise . all ( backgroundImages ) ; }
Process the files provided by the user and returns an array of BackgroundImages
 @function processUserImages
 @param {Array<Blob>} files Array of files provided by the user
 @returns {Promise<Array<BackgroundImage>>}
Process the files provided by the user and returns an array of BackgroundImages @function processUserImages @param { Array<Blob > } files Array of files provided by the user @returns { Promise<Array<BackgroundImage >> }
// Add file filter