Field configuration changes after clearing the cache I have a content type with only an image field where users can put multiples images.

Sometimes, after clearing the cache, the configuration of the field resets by itself and it sets the cardinality to 1, not letting users to more than an image.

How can I prevent this problem?
This is a strange problem which should not happen. I'm afraid you have some debugging to do. 

First of all, try to reproduce the problem on a clean installation with just Drupal core, no additional themes or modules. If you can reproduce the problem, you probably found a bug in Drupal core. Search in the issue queue if it has already been reported. If not, report the problem in a new issue.

If you cannot reproduce the error with just Drupal core, it must be a problem in your site. Duplicate the site (so you're not destroying work you have already done) and turn off modules one by one. Once the problem goes away, you know you have roughly located the problem. Then you can either try to debug the module yourself, or go to the issue queue of that module and try to work with the module maintainer to figure it out.