"You start out in life good, as a baby,” says the photographer Mario Testino. “Then you get wild. And when you hit maximum, you turn it around, so that when you get old, you’re good again. I can tell you, I’m 62 now, but between the ages of 20 and 50, I was too busy partying and enjoying life to do much else.” Not entirely. Along the way, Testino managed to take a few pictures too.

Across countless fashion editorials, iconic portraits (the late Princess Diana and Madonna come to mind), and image revamps of powerhouse fashion labels like Gucci and Burberry, he established a glamorously exuberant style. It was Testino who championed Gisele Bündchen when she was still an unknown, and who shot Kate Moss’s wedding to Jamie Hince. The royal family have had him on speed dial for more than two decades.

And yet, as we all do, Testino eventually asked himself, Is that all there is?

The shift came in 2007, after a massive earthquake devastated central Peru, not far from his hometown of Lima. “Save the Children asked me to donate a photograph that they could sell, and I chose the portrait of Diana,” he says, referring to the iconic image of the princess, newly divorced, that appeared on the cover of Vanity Fair in 1997. It is the only print of that image Testino has ever sold, and it fetched about $90,000. “With that one picture I was able to rebuild a clinic, and when I went to the opening, I couldn’t believe it. It was like this entire town benefitted from just the sale of that one picture.”

The following year, Testino was shooting his frequent subject and friend Natalia Vodianova in Moscow. “She was having one of her Love Balls there for the Naked Heart Foundation, and I donated a portrait of the winning bidder with Natalia and Eva Herzigova,” Testino recalls. “I think we raised 450,000 euros from it. Then Natalia invited me to see one of the parks her foundation built, and to my surprise it was part of a hospital for children with cancer. My brother died of cancer when he was 10. I was 15 then, and I sort of avoided the suffering of that moment. But here, with Natalia, it felt like the closing of a circle. Before, my giving was very reactive. If someone asked something of me, I would help. But this moment meant that I had to start doing something more.”

Around that same time, Testino began making monthly trips to Peru to visit his aging mother. In Lima’s historic Barranco district, he found a crumbling 19th-century building that piqued his interest. “I decided to buy it, at first just as a sort of depository.” Friends convinced him to renovate it and turn it into a museum, and MATE—Museo Mario Testino—opened in 2012. Alongside Testino’s images, including some from his “Alta Moda” series documenting Peruvian traditional costume, MATE shows the work of contemporary Peruvian artists; Testino also hopes to establish residencies for international artists.

In 2014, the same year Testino was presented with an honorary OBE for his contribution to photography and humanitarianism, the World Monuments Fund made him its board president in Peru, a country not short on important cultural sites in need of rehabilitation. Testino has also stepped up his association with Vodianova’s Naked Heart. Last year they opened the foundation’s first play park in the Americas, the Parque Teresita, in the rural Urubamba province, and others are in the works.

“Giving is like exercise,” Testino says. “No one likes to put their hand in their pocket, just like no one likes to go to the gym. But when you’re finished, you just say, ‘Wow! It is awesome.’ ”

See 81 fashion celebrities stand together for W's "I Am an Immigrant" video: