refactored image wrapping and container