writing tests for image upload