Added image filesize validation and some refactoring

ALLOWED_EXTENSIONS_TEXT is not defined anywhere, so the uploader breaks here when WAGTAILIMAGES_MAX_UPLOAD_SIZE is set to None.