I think the main reason why hostages/prisoners are released in good shape is it is better PR for the group releasing them. In some cases people taken hostage/prisoner will be well looked after if they are detained in a country with high standards. In the case in Gaza where these people were forcibly taken in horrendous circumstances, their captors need to release them looking well so that they, the captors, seem like decent people with a just cause. How many people in this country and around the world would continue to support the marches if the hostages had come out like those in the concentration camps did, beaten, starved and injured? It's all about PR and perception and mind games. Also, the hostages/prisoners are their currency - a bargaining chip. You don't damage the 'goods', or at least not when you are handing them back and the world is watching.
Why do those released look fit and happy? For similar reasons - they want to reassure their population, and those with relatives still in captivity, that they are doing more than just surviving. I'm willing to bet that captured soldiers in any dispute want to look 'in charge and defiant' to bolster up the courage of those at home.