When people are reminded of their own mortality, surrealist paintings they might otherwise find baffling can become sources of comfort.