Spin transition and thermal expansion in the layered cobaltite GdBaCo2O5.5