Implements media infrastructure and uses it for scaling uploaded images