refactor click on thumbnail and large version, but still doesn't work as expected