Environment friendly nanoparticles of quaternary compound Cu0.5MgxSnS4 for possible photovoltaic and photo-catalytic applications