Nanostructural inhomogeneities acting as pinning centers in bulk MgB2 with low and enhanced grain connectivity