It would probably be better to have a scope called nonempty or something to efficiently query for nonempty galleries.