We present a systematic study based on first principles molecular dynamics simulations of lead iodide perovskites with three different cations, including methylammonium (MA), formamidinium (FA) and cesium. Using the high temperature perovskite structure as a reference, we investigate the instabilities that develop as the material is cooled down to 370 K. All three perovskites display anharmonicity in the motion of the iodine atoms, with the stronger effect observed for the MAPbI$_3$ and CsPbI$_3$. At high temperature, this behavior can be traced back to the reduced effective size of the Cs$^+$ and MA$^+$ cations. MAPbI$_3$ undergoes a spontaneous phase transition within our simulation model driven by the dipolar interaction between neighboring MA cations as the temperature is decreased from 450 K. The reverse transformation from tetragonal to cubic is also monitored through the large distribution of the octahedral tilting angles accompanied by an increase in the anharmonicity of the iodine atoms motion. Both MA and FA hybrid perovskites show a strong coupling between the molecular orientations and the local lattice deformations, suggesting mixed order-disorder/displacive characters of the high temperature phase transitions.