I figured out it was the WPML Multilingual CMS Plugin that was causing the problem. (disabled all plugins and reactivated them one by one).
Then I found the solution on a WPML forum:
1. Go to your Media Library and locate an image file. Click on “Edit” to go to the “Edit Media” screen of this file.
2. Scroll all the way to the bottom of the page and look for the “Make ‘Media’ translatable” checkbox.
3. It should be disabled. If it is already disabled, enable it first the save. Next disable it and save again. This will cause WPML to re-save its settings.
4. Visit the “WPML settings” (“WPML -> Support -> Troubleshooting”) again and search for [custom_posts_sync_option] you’ll see that [attachment] is on 0 as it should be*.
* It should be either on 0 or not there at all!