Discover the gallery and fixed looping issue in some filesystems(gallaries)