The effect of a dielectric core and embedding medium on the polarizability of metallic nanoshells