Both are correct!
This photo was taken one second before a disaster --> Using "a" suggests that it was one of many possible disasters.
"This photo was taken one second before the disaster." --> This implies that both the speaker and the listener are aware of which specific disaster is being referenced.