The National Portrait Gallery bought the earliest known photograph of an American first lady, a daguerreotype of Dolley Madison likely taken in 1846, for $456,000.