Influence of the ionic size on the evolution of local Jahn-Teller distortions in cobaltites