Photon modes in photonic crystals undergoing rigid vibrations and rotations