My last comment was outdated, so I write it again.

It should be possible to save the image in a StringIO object instead of a harddisk. 1. You can not be sure that the user accessing openslides has write permissions on the filesystem. 2.It is slow to write the file. 3. If you create a temporary file, you should delete it afterwards.