Improved file upload with image preview