VID-1810 Redo the janky image handling that existed before

Should this function and the one above be part of the `File` object (or a child class) that is being manipulated? It seems like this is functionality that could be used across any extension/module that needs to render thumbnails.