I use iTunes to maintain sync between a directory on OS-X (with 121 subdirectories containing 13,698 photos in JPG format) and an iPhone 6s. The sync process always worked perfectly until the last IOS and iTunes updates. After the updates, the sync would stop after approx 2000 files though no errors were thrown to the user and it appeared that the import had completed normally. The problem appears to be that there is no error handling in the import process - when a problem is encountered, the import simply exits as if it completed normally.
After a bit (read hours and hours) of investigation, I found the solution, at least for my particular case. I imported the subdirectories one at a time and compared the count listed next to the directory in the Folder scroll box to the photo count I found after the import by hovering over the photos section of the size bar at the bottom of the screen. I discovered 4 of the 121 subdirectories had an issue.
NOTE - you have to run the subdirectories one at a time because, if run all at once, the import randomly pulls files from all directories and stops on error - so counts may be off other subdirectories where the files are OK but the import for that subdirectory may not have had an opportunity to finish.
I then moved the files in a problem subdirectory to an additional subdirectory in groups of 10 and tried importing those until I found the group where a file stopped the import - and then imported the files one at a time until I found the problem file. I discovered that the 4 problem subdirectories contained a total of 6 files that would cause the import process to exit prematurely.
To resolve the problem, I opened each of the 6 files in Snapheal and then re-exported them in JPG format overwriting the originals. All 13,698 files now import smoothly and the directories are in sync.
From Apple's end, I hope they will do 3 things:
1. Add an error trapping routine to iTunes sync which creates an entry in a log file when an error is encountered, noting the subdirectory name, filename and error type - and then continues to the next file.
2. Add a number to the top box, next to total photo count to be imported, showing actual number imported
3. If the numbers in step 2 do not agree, make a button visible which opens the log file to allow the user to trace and correct the problem.