Thomas-Ehrman shifts in nuclei around oxygen-16 and role of residual nuclear interaction