Bug 970936 - Fix intermittent failure in test_gallery_empty.py