If the image was uploaded manually, the filename cannot be optimized as filename optimization uses a template. For example, a product name, a collection name. Assets and custom image uploads do not have any template that it can work on. Only illegal characters are removed from the filename.