fix selection of gallery image by clicking thumbnail