medium: ui_resource: Flatten, then filter (#64)

Fix for previous commit: First flatten tags, then filter
out resources.