Mechanistic studies on the photochemical conversion of enaminonitriles to imidazoles