It's probably related to your inability to specify the exact framerate as an integer. If you're saying it's 30fps and it's 24fps then it would be out of sync. If you create the bif file by hand instead of relying on the batch file to make it for you, and it's in sync, then that might be the big problem for your solution.
Open virtualdub ( veedub64.exe )
Open your video file
Click disabled Aspect Ratio
Set the image to 320 x 240
It tells you the current framerate, but go to the bottom for "Decimate by" and enter the framerate *10 as an integer/round if necessary to 240 for 23.976 etc etc
Select File and Export / Image Sequence
select the directory to save the images and click OK.
When it's done, run biftool.exe from a command line, -t 10000 means it will set it for one image every 10 seconds, which matches your decimate by 10* framerate
biftool -t 10000 c:\foldername
That's all the batch file does. With proper operation if you rounded up from 23.97 to 24, then
23.97 * 60 seconds * 60 minutes * 2 hours = 172584
24 * 60 seconds * 60 minutes * 2 hours = 172800
If you do the math then your very last frame for the bif file in the rounded result will be 216 frames later than where it should be, which is within 8 seconds of film, but since the interval is 10 seconds it's barely even an issue.