Preview image upload is working but image is not getting uploaded