Allow the stream pipeline to be terminated early

This allows stream and source plugins to mark an image as "finished" and terminate processing the rest of the pipeline, returning it as-is.
Pull filetype validation into a stream process

This allows a source plugin to set the file type rather than the request being rejected the moment it is parsed, and also allows for custom filetype validators.
Merge branch 'allow_early_file_finalisation'