Waits for ajax to finish before saving screenshots
Check jquery exists before checking if any ajax is ongoing