async function processApiImages(whichGallery) {
  let apiUrl = "https://api.unsplash.com/search/photos"
  let clientId = "Lx5RhugSwSXlmegWIwokcglAySNjY7pzTgDjxgCHzzY";
  
  // await getFetch(apiUrl, {
  //   query: whichGallery,
  //   client_id: clientId
  // }).then((data) => console.log(data));

  let pageNumber = await getFetch(apiUrl, {
    query: whichGallery,
    client_id: clientId
  }).then((data) => data["total_pages"]);
  let randomPage = Math.floor(Math.random() * pageNumber);
  // console.log(randomPage);

  let fetchedImages = await getFetch(apiUrl, {
    query: whichGallery,
    page: randomPage,
    client_id: clientId
  }).then((data) => data["results"]);

  let newImages = fetchedImages.map(async (image) => {
    let imageUrl = await getBase64(image.urls.raw);
    return new BackgroundImage(
      imageUrl,
      {imgWidth: image.width, imgHeight: image.height},
      {userName: image.user.username, userProfile: image.user.links.html}
    );
  });
  return await Promise.all(newImages);
}
/**
 * Calls for the Unsplash API to retrieve processed images from the specified gallery
 * @function processApiImages
 * @param {string} whichGallery Name of the gallery to search for
 * @returns {Promise<Array<BackgroundImage>>}
 */
Calls for the Unsplash API to retrieve processed images from the specified gallery
@function processApiImages
@param {string} whichGallery Name of the gallery to search for
@returns {Promise>}
Calls for the Unsplash API to retrieve processed images from the specified gallery @function processApiImages @param { string } whichGallery Name of the gallery to search for @returns { Promise > }
async function processApiImages(whichGallery) {
  let apiUrl = "https://api.unsplash.com/search/photos"
  let clientId = "Lx5RhugSwSXlmegWIwokcglAySNjY7pzTgDjxgCHzzY";
  let pageNumber = await getFetch(apiUrl, {
    query: whichGallery,
    client_id: clientId
  }).then((data) => data["total_pages"]);
  let randomPage = Math.floor(Math.random() * pageNumber);
  let fetchedImages = await getFetch(apiUrl, {
    query: whichGallery,
    page: randomPage,
    client_id: clientId
  }).then((data) => data["results"]);
  let newImages = fetchedImages.map(async (image) => {
    let imageUrl = await getBase64(image.urls.raw);
    return new BackgroundImage(
      imageUrl,
      {imgWidth: image.width, imgHeight: image.height},
      {userName: image.user.username, userProfile: image.user.links.html}
    );
  });
  return await Promise.all(newImages);
}
async function processApiImages ( whichGallery ) { let apiUrl = "https://api.unsplash.com/search/photos" let clientId = "Lx5RhugSwSXlmegWIwokcglAySNjY7pzTgDjxgCHzzY" ; let pageNumber = await getFetch ( apiUrl , { query : whichGallery , client_id : clientId } ) . then ( ( data ) => data [ "total_pages" ] ) ; let randomPage = Math . floor ( Math . random ( ) * pageNumber ) ; let fetchedImages = await getFetch ( apiUrl , { query : whichGallery , page : randomPage , client_id : clientId } ) . then ( ( data ) => data [ "results" ] ) ; let newImages = fetchedImages . map ( async ( image ) => { let imageUrl = await getBase64 ( image . urls . raw ) ; return new BackgroundImage ( imageUrl , { imgWidth : image . width , imgHeight : image . height } , { userName : image . user . username , userProfile : image . user . links . html } ) ; } ) ; return await Promise . all ( newImages ) ; }
Calls for the Unsplash API to retrieve processed images from the specified gallery
 @function processApiImages
 @param {string} whichGallery Name of the gallery to search for
 @returns {Promise<Array<BackgroundImage>>}
Calls for the Unsplash API to retrieve processed images from the specified gallery @function processApiImages @param { string } whichGallery Name of the gallery to search for @returns { Promise<Array<BackgroundImage >> }
// await getFetch(apiUrl, { //   query: whichGallery, //   client_id: clientId // }).then((data) => console.log(data)); // console.log(randomPage);