I know with 5.2 and the new cache there where additional switches added to refresh the cache. You might want to ensure you have uploaded all the new files by uploading everything except the two config files.
I just tested an upload on my test site and the counts are incremented accordingly.
Right in image-inc.php at the bottom of the function that process's images is this
// Let's update the category cache
return( $lastphotoid );