diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 8f1a9e9ef..3e8aae6db 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -82,8 +82,8 @@ Gallery = $.on window, 'resize', Gallery.cb.setHeight - for file in $$ '.post .file' - post = Get.postFromNode file + for postThumb in $$ Site.selectors.file.thumb + post = Get.postFromNode postThumb continue unless post.file?.thumb Gallery.generateThumb post # If no image to open is given, pick image we have scrolled to.