Reshaping ultrashort light pulses in resonant photonic crystals