Analysis of an imaging magnetic energy filter