Added watchdog to waitForImages to avoid waiting forever