That is a … feature of this script, called deeplinking. It should be fixed already, maybe you missed an update?
As you can see in that commit, you can disable it by editing assets/js/prettyPhoto/jquery.prettyPhoto.init.js
. Add
deeplinking: false
… to all calls of prettyPhoto({});
.