Fix #815, add webp support