Fix picture upload

Fixes #341
Fixes #340
Fixes #338