Bb 1546

Tests for image uploads + bugfix