Issue #8456 by tuj: Added handling of empty slides array (now retries until not empty).