Image viewer, pure javascript