adding waitForImages.js