// copy the image into the local output-storage
// todo: Implement data-fingerprinting so that we can detect the mime-type
final OutputRepository storage = outputRepository.openOutputRepository("Pictures", null);
final DefaultNameGenerator nameGenerator = new DefaultNameGenerator(storage);
final String name = nameGenerator.generateName("image", mimeType);
final OutputStream outputStream = storage.createOutputStream(name, mimeType);
final ByteArrayInputStream bin = new ByteArrayInputStream(data);
try
{