Consolidated animation code for BrickStacks and ImageMass into the Mass type.