Production of γ quanta in π−N interactions at 40 GeV/c