Calling /api/access/datafile/<id>?imageThumb=400 works for file types that have a thumbnail/where a thumbnail can be generated, but it just sends the original file for filetypes for which thumbnails can't be generated. It seems like a 404 would be a better default (avoids downloading large files accidentally and I think it stops the bad thumbnail call from counting a download).
For a quick look, it appears that not being able to create a thumbnail causes the execution to hit this in the Access class:
} else {
// Service unknown/not supported/bad arguments, etc.:
// TODO: throw new ServiceUnavailableException();
}
Unless there are objections, or better ideas, I can look into throwing this exception or otherwise replying with a 404.