Compositional dependence of structural properties and bandgap of Mg-Co spinel nanoferrite