...
- Load the file as an image, resize it using the ImageCache toolset, then replace the FileUpload control with the uploaded and rescaled image.
- Check whether the data format of the file is acceptable and if not show an error and clear the FileUpload component again.
Layout notes
The current layout uses too many classes in my op.
The layout was tested with this fiddle.