I'm really not sure about these... The files should be made temporary as soon as they are created; otherwise, they can be left over if a step in the processing fails before we get here... The logic as it is here can just result in keeping the files around for longer.

So yeah, we should:

1. Register files as being managed as soon as possible (so cron will clean them up if we error out)
2. Allow the derivative code to clean up early