Image layout algorithm, which makes multiple images fit to the width of container.