there is another one, but more specific, but it comes before location ~ ^/images/:
location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" {
}
location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" {
}