On the relation between chemical composition and optical properties of detonation nanodiamonds