The caching system is actually pretty simple once you understand the basics.
When a visitor opens a page for the first time, 4images creates a unique string (cache_id) based on some specific parameters. After it compiled the page, it saves it into ./cache/catche_id files. If any of the parameters changed or cache files expired when the page refreshed, then a new page generated, otherwise it shows page from cache instead.
The cache_id generated via create_cache_id() function and you can find it some of the main .php files, such as details.php and categories.php
function create_cache_id() accepts an array of the parameters, so adding more parameters will change when it's going to show cached pages or generate new, the parameter order is irrelevant.
Knowing the basics and knowing when we it shouldn't show cached pages (in your case when new images added or new subcategory added), we can use the following parameters:
$subcat_ids = array();
get_subcat_ids($cat_id, $cat_id, $cat_parent_cache);
$cache_id = create_cache_id(
'page.categories',
array(
$user_info[$user_table_fields['user_id']],
$cat_id,
$page,
$perpage,
isset($user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 0, 8) : 0,
$config['template_dir'],
$config['language_dir'],
$cat_cache[$cat_id]['num_images'], //if number of images changed
@count(@$subcat_ids[$cat_id]), //if number of subcategories changed
)
);
P.S.
The GET_CACHES constant has nothing to do with the caching system, it's for categories caches only, it's required pretty much throughout every page, because it's generates $cat_cache array.