public void insertImage(TemporaryImage temporaryImage, Image image) {
checkNotNull(temporaryImage, "temporaryImage must not be null");
checkNotNull(image, "image must not be null");
checkArgument(image.getId().equals(temporaryImage.getId()), "image IDs must match");
try {
InsertToken insertToken = freenetInterface.new InsertToken(image);
insertTokens.put(image.getId(), insertToken);
freenetInterface.insertImage(temporaryImage, image, insertToken);
} catch (SoneException se1) {
logger.log(Level.WARNING, "Could not insert image!", se1);
}