The cause
The problem caused by an incorrect implementation of this module (Webkul_ImageGallery
).
The module for each gallery stored the identifiers of the pictures in that gallery as a text string of the form «1,2,11,12,13,14,15,16...» where the natural numbers are the identifiers of pictures.
The module limited this string to 255 characters.
It is easy to see that storing all such natural numbers > 9 takes 3 characters (for example: «14,»), and 255/3 = 85, and the 86th picture was placed at the expense of the first two natural numbers that ≤ 9 («1,2,»).
Of course, this data storage architecture is wrong.
The solution
ALTER TABLE `wk_gallery_gallery` MODIFY `image_ids` TEXT NOT NULL;