I love vultures, and not just because they’re charismatic, intelligent, and physiologically incredible. No, I love vultures in a really sick way too. What they do when they feed on a carcass is repulsive but—let’s face it—it makes for fascinating viewing.

Vultures are the ultimate antihero: They’re ugly, aggressive, and have pretty rotten feeding habits. But they’re also one of the fastest declining families of birds in history—and that’s why National Geographic featured a story about them in the January 2016 issue.

View Images A Rüppell’s vulture lays claim to a dead zebra in Tanzania’s Serengeti National Park, while other Rüppell’s and white-backed vultures move in for a piece of the action. They can strip a carcass clean in minutes. Photograph by Charlie Hamilton James, Nat Geo Image Collection

Vultures are the world’s forgotten environmental disaster. Lions, elephants, and rhinos are in serious trouble—but vultures are arguably in more. In South Africa, for example, six of eight species in the country are endangered.

Vultures don’t have the look and appeal of other creatures, but the role they play within their ecosystems is of great importance. On the plains of the Masai Mara in Kenya, for instance, vultures consume more dead animals than all the predators and scavengers put together.

View Images A vendor peddles the skeletal remains of a lappet-faced vulture at a muthi, or medicine, market in Johannesburg, South Africa. Demand is on the rise for vulture parts, particularly the brain, which when dried is rolled into cigarettes or inhaled as vapor. The skin of a pangolin—among the most trafficked animals in the world—lies on a bin on the right. Photograph by Charlie Hamilton James, Nat Geo Image Collection

View Images Sprinkled on carrion, a few ounces of the insecticide carbofuran (above) can kill a hundred vultures. Photograph by Charlie Hamilton James, Nat Geo Image Collection

I’ve spent a lot of time filming and photographing vultures, and one thing I’ve learned is that they don’t like cameras. They’re smart, shy birds and are always on the lookout for anything suspect. I knew photographing them up close was going to be tricky.

Here’s how we got the photographs for this month’s magazine story.

View Images An adult Rüppell’s vulture attacks another. Aggressive encounters are very common when the birds are feeding, as each bird fights to secure and hold a choice position on the carcass. A vulture’s tough, stretchy neck skin means interactions like this one rarely cause any damage. Photograph by Charlie Hamilton James, Nat Geo Image Collection

My friend Simon Thomsett and I were on the plains of East Africa with expert wildlife driver Basili Peters. We had a Landrover loaded with gear and a workshop set up in our camp. Every day we drove around the plains scanning for vultures or dead animals. I was shooting with a long lens to capture images of vulture behavior—fighting, feeding, and preening. Then we needed close-up wide shots. To do that, we aimed to find a fresh carcass and rig it with cameras. I thought I could dress a Canon 50D with camouflage and simply stick it next to, or in, a dead animal. Simon assured me it wouldn’t work, but I love proving him wrong.

We found a wildebeest carcass with feeding vultures. I leaned out of the car, placed the camera with a wireless trigger by the head and we drove off. The vultures rushed back in to feed—then immediately stopped a couple of feet from the camera. Simon was right.

View Images Putting cameras in cavities isn’t a nice job! Photograph by Charlie Hamilton James, Nat Geo Image Collection

We tried this a few more times. It’s dark inside a dead animal and the exposures were slow. The birds knocked the camera over as they tugged at the carcass with their powerful necks and beaks; so I was left with lots of frames of dark smeared blood and guts and a very messy lens. I had to find a solution.

First, we tried making a paper-mache wildebeest skull and putting the camera in it. That didn’t work. We made a replica tree stump, and the vultures didn’t go within a hundred of it. Then I started to think “GoPro.” And that finally worked.

View Images With good light the GoPro produced a pretty acceptable still photo. Here, it’s focused to around a foot while photographing Rüppell’s vultures and African white-backed vultures feeding on a wildebeest on the Ndutu plain in Serengeti National Park. Photograph by Charlie Hamilton James, Nat Geo Image Collection

The vultures took no notice of the GoPros, but all the pictures were out of focus because of the infinity setting. I’m the kind of guy who will bust open a camera to fix it, so I took apart one GoPro, then another, and adjusted the focus by putting a small piece of cardboard between the lens and the sensor.

With this, we started getting intimate, action-packed images of the vulture feeding scrum in the carcass, and I shot 20,000 frames on the GoPro before deciding to try something else.

View Images After a few days in the gut sack of a carcass, the Lumix was starting to rot. You can guess what that brown stuff is. Photograph by Charlie Hamilton James, Nat Geo Image Collection

I had a Panasonic Lumix GX7 that Panasonic kindly lent me. It’s a mirrorless camera that has a silent mode, shoots RAW, and has a remote cable release—seemingly perfect for this job. After solving a huge amount of technical problems, we deployed it in a carcass. But again the vultures didn’t like the big lens.

Three weeks into the shoot I started to worry. This was my first big story for National Geographic and it wasn’t cheap! I had lots in the bag but I didn’t have that one shot, the one that blows everyone away. But I never gave up. I persisted to the point that even Simon was saying, “Give it up.”

View Images Even Darwin called them “disgusting.” But vultures are more vital than vile, because they clean up carcasses that otherwise could rot and spread pestilence. Here, a Rüppell’s vulture rips tissue from the trachea of a dead wildebeest. Photograph by Charlie Hamilton James, Nat Geo Image Collection

But things started to slowly change as the vultures and I began to understand each other. Some of them were getting bold. Vultures watch each other obsessively and take cues from each other. If one eats at a carcass with a camera, then others pluck up the courage to do the same. We realized if we sped in during a feeding frenzy, dropped the camera and sped off, the birds piled back in without noticing the camera.

View Images Finally, just a few days before we finished shooting, the plan worked and we got the dream shot. Photograph by Charlie Hamilton James, Nat Geo Image Collection

This is the shot I want. It has everything—action, aggression, nice light, perfect framing. It tells you how vultures live together, how they feed, where they live. The rib cage winds out of frame perfectly, and the main vulture has its beak open. The aggressive foot coming in is perfect, and a wing frames the top of the image. You can even see a marabou stork and a vulture quietly waiting their turn. I couldn’t have dreamed of a more serendipitous frame.

View Images In the Serengeti a golden jackal takes umbrage at an immature white-backed vulture butting in on its meal of dead wildebeest. Photograph by Charlie Hamilton James, Nat Geo Image Collection

The Lumix was literally dripping in blood, stomach contents, and fecal matter. Simon tried to clean it with alcohol and a toothbrush but all the switches and the beautiful black surface turned dark red and green. The lens was smeared with liquid so horrible I can’t describe it. The GoPros all stank; one was urinated on by a jackal. The others had scratched lenses. The marabou storks picked up the GoPros and wandered around with them. We ran over one with the Landover—it lived.

How Simon and I didn’t get brucellosis, TB, anthrax, giardia, or any other disease I don’t know; perhaps the bottle of Dettol we lived with saved us. It’s a dirty business messing around with vultures but a fun one. I have a very big place in my heart for them. They are very special creatures, and we need them more than we know.