Count John Quincy Adams among those who could be grumpy about having their picture taken.

In August 1843, the former president, then 76, sat for a photographer during a visit to upstate New York and pronounced the results “all hideous.” Unfortunately for him, a daguerreotype from that sitting surfaced at an antiques shop in 1970, priced at 50 cents, and currently sits in the National Portrait Gallery, where it laid claim to being the oldest surviving original photograph of an American president.

But now, an older — and more flattering — daguerreotype of Adams, the sixth president, has surfaced and will be sold at auction at Sotheby’s in October. The daguerreotype, which carries an estimate of $150,000 to $250,000, was taken in a Washington portrait studio in March 1843, when Adams was in the middle of his post-presidential career in Congress. He gave it as a gift to a fellow representative, whose descendants kept it in the family while apparently losing track of its significance.

Emily Bierman, the head of Sotheby’s photographs department, called it “without a doubt the most important historical photo portrait to be offered at auction in the last 20 years.”

“Not only is it an incredibly important historical record,” she said, “it’s also a stunning composition. You really get a sense of who Adams was.”

“I keep getting caught on his cute socks,” Bierman said, noting the white patch peeking out from a trouser cuff in the newly surfaced daguerreotype. “There is something so human about that.”

Claims of historical precedence tend to come with asterisks, and it must be noted that the daguerreotype, a so-called half plate measuring about 5 by 4 inches, is not, technically, the earliest photographic image of an American president.

That honor belongs to William Henry Harrison, who had his likeness taken in 1841, around the time of his inauguration. He died 32 days into his term, and the original daguerreotype is not known to have survived, though the Metropolitan Museum of Art owns a copy, made by the Boston firm Southworth and Hawes around 1850. And Adams himself was first photographed in 1842, by the Boston photographer John Plumbe Jr., though the images appear to be lost.