Default installation of D8 treatment of .gif accesses? If I request a non-existent URL, say, /ddddd I get Page not found (as expected). If I do th4 same with an unusual extension /dddd.xcf I also get Page not found.

BUT if I request /ddddd.gif there's an Apache error as opposed to a 404?

I'm guessing this has something to do with security, but can someone clarify this?
By default drupal serves a different 404 page to save computational effort if it  is matching the following regex:

'/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'


You can configure this in the settings.php (Fast 404 pages) or in the config('system.performance')->get('fast_404.paths');