image: Improve store locking Upstream-commit: e64c2d7122158d7d8583ff6967c3e4a833042c25 Component: engine