Andromeda galaxy has 2 different meanings across 2 categories:
a spiral galaxy in the constellation of Andromeda that is visible to the naked eye
A spiral galaxy in the Local Group and closest to the Milky Way, visible to the naked eye in the constellation of Andromeda, the brightest of the Messier objects and often referred to by its designation M31.