write tests for image upload