make the photo upload work asynchronously on android plus cleanup