A flash won't work, but if the candle in the pumpkin is the only light source, the photo will only show the design and not the pumpkin. To show both design and pumpkin, try using a single light source, slightly forward and above of the Jack O Lantern. Washing the inside with a mild bleach solution will slow the process of decay. Coat the cut edges of the pumpkins with petroleum jelly to help them last longer. The longer the candle is left burning, the quicker the pumpkin will decompose.
Electric lights work well instead of candles.
If you really want to make your creations last, put them in a plastic bag and store them in the refrigerator when not on display. You can re-attach and repair broken pieces with toothpicks or straight pins. Discourage squirrels and other critters from making a meal of your pumpkin by sprinkling it with liberally with Tabasco sauce or cayenne pepper. They make a delicious, nutritious snack. Follow this link for the recipe.