Quick follow up - I was working with Watexy, which replaces text with
LaTex rendered images of the same text (you surround the string to be
replaced with $$), and it looks like images may take up 0 character
"spaces." If you experiment with the Watexy bot, you'll find that if
you replace 2 separate equations in a single line of text, one of them
- the first - will work properly, and the second will not. However, if
you count the length of the _text_ in each, the difference comes out
to the total length of the replaced text..
The text I used to test was the 34 character string:
Testing $$10x2=20$$ and $$3^2 = 9$$
When modified by Watexy, you get 12 characters of text, with the
images inserted where noted.
Testing (Image) a(Image)9$$
The total length of the text replaced by Watexy is 22 characters,
which means - if I've got my head on straight - the two images take up
no string space. Thus, your offset would be based solely on the length
of the URL's being replaced, and doesn't have to account for the size
of the image. Hope a) I got that right, and b) it helps!