code: synchronized void saveDigestAndRenameCheckpointImage(
        long txid, MD5Hash digest) throws IOException {
      if (!digest.equals(storage.getCheckpointImageDigest(txid))) {
        throw new IOException(
            "Checkpoint image is corrupt: expecting an MD5 checksum of" +
                digest + " but is " + storage.getCheckpointImageDigest(txid));
      }
         
      imageSet.saveDigestAndRenameCheckpointImage(txid, digest);
      
      // So long as this is the newest image available,
      // advertise it as such to other checkpointers
      // from now on
      storage.setMostRecentCheckpointTxId(txid);
    }
docs: This is called by the 2NN after having downloaded an image, and by
  the NN after having received a new image from the 2NN. It
  renames the image from fsimage_N.ckpt to fsimage_N and also
  saves the related .md5 file into place.