Photostability can be significantly modulated by molecular packing in glasses