Replace file size check in API.media_upload with chunked parameter
The simple upload endpoint seems to accept media file sizes much larger than documented, as long as the size after Twitter's API processes the media is below 5 MiB (e.g. through compression, stripping whitespace, etc.). This makes any file size checks prior to uploading to the API potentially overly restrictive.
Regardless of this, MAX_UPLOAD_SIZE_STANDARD was already lower than necessary anyway, as the limit appears to be 5 MiB rather than 5 MB, as the error message when using chunked upload for a file larger than 5 MiB, "File size exceeds
5242880 bytes.", indicates.
The simple upload endpoint seems to consistently respond with a 413 Payload Too Large HTTP response status code when the uploaded file is too large, even after being processed, which should make it fairly apparent that the file is too large.
Most GIFs should be under 5 MiB, but for larger GIFs that the simple upload endpoint will error for, using the chunked parameter will be necessary. Adding this parameter also allows chunked upload of images less than 5 MiB as desired.