fixes #18294, fix permissions and strip away copyrighted ICC profiles

(cherry picked from commit 5fe93c7da002b47b0a040412a37f1cfe74c6a5bd)