fixed xss vulnerability

Escape hashRel and parse hashIndex as integer.
Example: http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/#prettyPhoto[pp_gal]/2,<a onclick="alert(1);">/