Perhaps checking `null` here is a good practice. Same for the method `isWebPFile`.