Removed unused Gallery._get_thumbnail_name.
Cleaned up Gallery cache implementation.