prevent deletion if image is used by a running container

Fixes #2412