fixed #230, also changed stream.atEnd() to gallery.atEnd() for better clarity (no change in behavior intendend)