Fixes image permissions.