Galaxies and Cosmology