Bug 1110158: Intermittent test_gallery_handle_valid_image_file.py failure fix