Role of lone-pair electrons in reversible photostructural changes in amorphous chalcogenides