A location chooses what Nginx does with a path. A more specific-looking rule does not always win: exact matches, prefixes and regular expressions have different priorities.
Start with three rules
These locations are siblings inside one server block:
location = /health { return 200 "health"; }
location /images/ { return 200 "images"; }
location ~ \.jpg$ { return 200 "jpg"; }
