Image upload bug fix