Connect middleware for optimal image serving. Switches to webp/jpegxr if possible