Control height gripper as function of thickness of workpiece and height of pallet