There are too many stars (50) on the American flag that appears. There weren't 50 states yet in the 1880's.
The post about the flag having 50 stars is incorrect. Each flag seen in the episode has 37 stars, indicating this episode took place between July 4, 1867 to July 3, 1877.