Yes. Both, images that already exist when the module is installed and images that are added later are optimized.