[Olena-patches] 602: Take borders into account in data allocation of image2d.