Add file type checking and preview the image before submit