Theoretical model of photostructural changes in glassy semiconductors