Ever had your boss take credit for your work? Then you can sympathize with the great Civil War photographer Alexander Gardner. Sent by his employer, Mathew Brady, to take photos of the Battle of Antietam in 1862, Gardner pretty much invented the field of photojournalism with his portraits of dead soldiers, National Portrait Gallery historian David C. Ward says.

Brady put his name on Gardner’s photos and, as a result, “lots of people think Mathew Brady took every photo of the Civil War,” Ward says.

Dark Fields of the Republic: Alexander Gardner Photographs, 1859-1872,” opening Friday at the National Portrait Gallery, will help rectify that injustice.

“These images take us back to this heroic, tragic, contentious, violent period in American history, and Gardner was there to document all of it,” Ward says.

Gardner’s pictures are all the more astounding considering his working conditions, Ward says. The photographer traveled in a carriage, carrying delicate equipment along rickety roads to battlefields where thousands of corpses were putrefying in the sun. After positioning his bulky camera, Gardner mixed a bath of noxious chemicals by hand, applied them evenly to a plate of glass, put the plate in the camera, unscrewed the lens cap and replaced it at the exact right moment. Retreating to his portable darkroom, Gardner had 10 to 20 minutes to develop the negative before it disappeared forever.

The photographs showed a brutal side of war that most people had never seen before. Gardner captured the scale of the carnage with images of corpses organized into rows or zigzagging across the barren landscape.

When Brady exhibited Gardner’s work in New York, it was a huge success. People just couldn’t stop looking at the graphic images.

“I think people liked them because there is an attraction to the violence,” Ward says.

That success gave Gardner the courage to strike out on his own. In 1863, he opened a studio in Washington, D.C., and his first customer was President Abraham Lincoln. That was the first of many portrait sessions, in which Gardner documented the toll of the war on Lincoln’s increasingly careworn face.

After the Civil War, Gardner was hired by the Union Pacific Railroad to photograph the vistas of the West. He also took pictures of the 1868 peace talks between Northern Plains Indians and the U.S. government in Wyoming.

“His photos of the Lakota Sioux were as dignified as his photos of Abraham Lincoln,” Ward notes.

In 1872, Gardner made a surprising career move: “He up and quit and became an insurance broker,” Ward says. Perhaps he felt he’d seen enough violence for one lifetime.

Or, “maybe it was too much competition, or the work was too hard, and insurance just seemed like a better way to make a living,” Ward says.

He died 10 years later, but his striking photos continue to provide a portal to a critical moment in American history.

“Gardner forever changed the way people look at war and photography,” Ward says.

National Portrait Gallery, Eighth and F streets NW; Fri. through March 13, free.

More stories from Express