Flexible and specific contributions of thalamic subdivisions to human cognition