waitForImage = () => {
  return new Promise((resolve, reject) => {
    const img = document.querySelector("[alt=LS]");

    if (!img || img.complete) return resolve();
    // this should be rewritten to isReady when it is ready
    img.onload = () => {
      setTimeout(resolve, 100);
    };
    // if image is not loaded in 10 seconds, reject
    setTimeout(reject, 10000);
  });
}
Wait for the main Image object to be loaded