Fixed image viewer JS (old code still existed)