sky please share more details.
Does it happen to all users and all image files, or just to a specific user or with a specific file?
Did it work previously? Is this a new Flarum installation? What's your host setup? OS, webserver, managed?
The error message indicates the file being sent might not be a valid image. But the message could also appear if the webserver doesn't pass the file to the PHP process correctly.