I think the earliest daguerrotypes may have been invented in the 1830s. A few photos exist taken in the Mexican War. I have a photo of my great-great-great-grandfather with his second wife, taken sometime between 1853 and his death (about 1871). His first wife, my ancestor, died in 1852--but I sometimes see the photo of the second wife identified as the first wife.
My Revolutionary War ancestor died in 1822, before photography, but I run across a photo online identified as him--actually of his nephew who had the same first and last name.