added upload image function, almost working