Gamma-ray emission from self-confined cosmic rays around their galactic sources