As described in SUPPORT-8316 and Karel described for requests such as 'https://www.magnolia-cms.com/.imaging/heya' which point to non existing resources or invalid URL:
When calling an invalid URL we get an error 500.
I would assume that the result should be a 404. Why do we get a 500. Following the execption it looks like this is cause directly inside the AggregatorFilter.
Correctly return HTTP error code
Provide 'Default error pages for public instances' (why not also author instance) – ONDEMAND-1448