put upload picture code into it's own method