Chromophore aggregation and photoinduced dichroism in sol-gel films