Make meta box appear if the previous if not empty?

This more of a PHP + Logic question than a WordPress one but I think the solution is pretty simple.

  1. Loop through some code to generate the existing boxes or the boxes with
    existing values
  2. And always print one empty box for a new image.

For example:

foreach ($my_existing_boxes as $k => $v) {
  // not sure how your code works exactly
}
new MultiPostThumbnails(
  array(
    'label' => 'New Image',
    'id' => 'feature-image-new',
    'post_type' => 'listing'
  )
);