Fixed a regex bug and optimised the ImageUploadField.