Study of multi-gamma final states from π−p interactions at 40 GeV/c with invariant mass above 2 GeV