Fixed the image preview/upload bug