When a folder is removed from the library, images under that folder are
now properly cleaned up from the database if they are not covered by any
other registered paths. This fixes the issue where Random Image would
pull from folders that had been removed.
The cleanup logic checks if each image is still "owned" by any remaining
scanned path before deletion, supporting nested path scenarios where a
parent path may still contain the images.
Fixes#868
Co-Authored-By: Claude <noreply@anthropic.com>