This way, the code using it becomes clearer and we can use it in multiple places without accidentally doing it wrong (hint: see next commit).
Add support for the tiff format, which is flexible enough to handle all our memory texture formats without loss. As a consequence, we are now linking against libtiff.