Beam test calibration of the balloon-borne imaging calorimeter for the CREAM experiment