Based on my tests, if the item is assigned to a category it has to be included in the filename.
Just as a side note, we originally had a second level of categories, which the customer decided to do away with (ie. only one category level now). However, the images, with cat1 and cat2 appended to the name, are still displayed (yes, even after refreshing the cache). 🤪