Measurement of Branching Fractions and Mass Spectra of B→Kππγ