Trapped and precipitating protons in the inner magnetosphere as seen by IMAGE