implement upload pic function