It sometimes happened when changing image_* cvars for compression and
then vid_restarting and then running listImages.
In one case the whole process hung and len was a ridiculously big number
=> most probably the (unsigned!) size_t overflowed by subtracting a
number > len (most likely from input_field.GetCursor()).
So I just made it a plain signed int.
I couldn't reproduce the issue anymore after doing this change.