Fixed the function of image uplaod