Commented everything and adjusted the pan function so that the panned position is retained when the image is zoomed.
Merge remote-tracking branch 'origin/master'