Intelligent cropping for flexible image containers