docker_image: added support for docker_py >= 0.3.0, Docker API >= 1.8. Merged with #6171

Fixes problems with new versions of Docker (Docker API, docker-py).
Also merge with @joshuaconner docker module implementation #6171.