The boundary between language and dialect is often a political one. As you said Galician and Portuguese are officially distinct languages, but should be considered dialects of a same language. Same for Flemish, Dutch and Afrikaans ; Czech and Slovak ; Croatian, Bosnian and Serbian ; Belarus, Ukrainian and Russian ; Turkish, Azerbaijani and Turkmen ; and so on. Language names are made to fit political borders.