Add counter cache for gend images to src image.
Sort source images by the number of images generated from them.