Astronomers may have uncovered how galaxies change their shape