Photos of soldiers were not something that was part of their permanent records. Do you have any information on your ancestor? DOB, place of birth?
Dear Susanne Clark,
Thank you for posting your request on History Hub!
According to a National Archives website, during the Civil War dozens of photographers, both private individuals and employees of the Confederate and Union Governments, photographed civilians and civilian activities; military personnel, equipment, and activities; and the locations and aftermaths of battles.
After the war, some of the photographs taken by private individuals were purchased by or donated to the War Department. These private photograph collections were later transferred to the National Archives at College Park - Still Pictures (RDSS) along with the permanent government photograph collections. For access to these collections, please contact RDSS via email at firstname.lastname@example.org.
Please see these previous responses to questions, which may also prove useful:
We hope this information is helpful. Best of luck with your family research!