In file:
index.php
We have a hardcoded value 10000 in code:
$cat_owner_id = ($cat > 10000)?(10000 - $cat):(10001);
I think it must be replaced by this one:
$cat_owner_id = ($cat > FIRST_USER_CAT)?(FIRST_USER_CAT - $cat):(FIRST_USER_CAT+1);
That's wrong as far as I can see. Personal galleries start at 10000 no matter what.