Spontaneous magnetization in the presence of nanoscale inhomogeneities in diluted magnetic systems