Uh, they won't freeze if you just hold them upside down (or do they? I've never tried).
If you release all the air from them, then there's a simple explanation. I'll simplify it as much as possible. A pressurized gas will decrease in temperature as the pressure is released, and increase in temperature as the pressure is increased. This is how most cooling systems work. A gas is compressed causing an increase in temperature. It is then passed through a radiator to bring it to room temperature. Then it gets pumped where it is needed and the pressure is reduced. The gas cools, and draws in heat from it's surroundings, thereby cooling them. The now near room temperature gas is compressed, heating it up, and is passed it back to the radiator again to continue the cycle.
edit: clarity