Use webp in path only when webp is supported

It seems that the logic is reversed. This shall fix it.