Search for the decay D0→γγ and measurement of the branching fraction for D0→π0π0