Flexible image count per row when resizing