Use `.distinct` when fetching `planters_ids` to avoid duplicate member
IDs and replace `photos.size` with the `photo_associations_count`
counter cache column for `has_photos`.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>