Search for D0 --> gamma gamma and improved measurement of the branching fraction for D0 --> pi0pi0