fix uploading image bugs from Heroku