Best way for svg and webp

whats the best way to handle svg and webp images when using phthumb and image++, put a if output modifier iss how I do it now is there not a better way?