fix bug to upload images