Refactored File/Image form widgets to share more code (and behave better)