Search for resonant diphoton production with the D0 detector