Enhance error handling for save functions in webp