The pope stopped to greet a pair of dog walkers as he returned to the Vatican after spending five weeks in hospital.