Hadronic shower reconstruction in an imaging calorimeter