Fix various path issues when viewer is not in its own subdomain

Also fix a rotation issue on IE8 on series
Rotate thumbnail image as well on first load