Fixed mass_tagger bug when selecting images with similar ids

The mass_tagger extension behaves incorrectly if the id of an image is
the same as the ending of the id of another image.

Example:
Select image 143: var string == "143:"
Select image 113: var string == "143:113:"
Select image 43: var string == "1113:"
So either the wrong image will be tagged, or it will cause an error if
that image doesn't exist.
Remove tags from images using mass_tagger

Using negative tags removes them from the selected images.
Merge pull request #435 from geosohh/master

Fixes for mass_tagger extension