I found that with gallery 1.5.2-pl - I guess even earlier versions - Gallery doesn't skip deleted photos in calculation of photo count. So when you edit a gallery to upload photos or edit them, Gallery tells you, that there are 54 Photos, but doesn't show all of them until you say "show me the first 100". Thats annoying, but you can work around this.
The real problem is, when you want to select a Gallery photo as a TV. There you just can switch pages, but the last page doesn't show the last photos, as they are after the last index value...