How to make sure the uploaded file is really an image?

Uploadcare checks file content to approve that uploaded file is an image. If you see is_image flag set to true, you can be sure it is an image that Uploadcare CDN can work with. There are limits imposed on CDN.
Images that exceed resolution or size limits are treated as non-images. All non-image files are distributed "as is".

See the Pen Uploadcare Widget & simple form by uploadcare (@uploadcare) on CodePen.

Also, you have an access to our REST API and you can check file properties (without the need to get actual file).

For more information about file validation see Is it possible to validate the file type?