Add thumbnail API

... so we can start using it for media library, etc.