Optical spectra of organic dyes in condensed phases: the role of the medium polarizability