Use statifiles instead of custom media handling