Photographs at 500,000 frames per second of combustion and detonation in a reciprocating engine