Photon Scattering by Compounds: an Assessment of the Validity of the Independent Atomic Model Approximation