When several diagrams are in the same text file (e.g. f.txt), the output file for the first diagram is named f.png. Subsequent output files are named f_001.png, f_002.png etc...
If the first diagram is split on several pages, using the page(hpages)x(vpages), the first page will be in f.png (consistent with name of first diagram) but the second page will in f_001.png, and the second diagram will also be in f_001.png. The viewer shows the same twice, but the diagram content is the same (it's the second diagram).
The workaround I have is to create a first diagram with a title only, thus generating an otherwise useless f.png
Example to reproduce the issue: have the following text in the same text file:
title diagram 1
title diagram 2