Stable rc

Fix various crashes in the web interface. Fix capture-replace and most of the numbering inconsistencies.
Yup, I just checked, it's an incongruency between server/client code. The server expects a 'numtype' request parameter to switch between 'capture_num' or 'sequence_num' for indexing, but the client never passes one.
I'll fix this on my commute, the easiest way is to just ignore the sequence number when obtaining images and always refer to pages by their capture number.