Interplay of order and disorder in the optical properties of opal photonic crystals