Contrasting physical properties of the trilayer nickelates Nd4Ni3O10 and Nd4Ni3O8