Morphological, structural, thermal and optical properties of Zn/Mg-doped TiO2 nanostructures for optoelectronic applications