Use a per-basePath mutex for gallery locking