refactor pull_image method in docker module