Add waitForImages method.