<?php 

// Returns how many image fields there are, given the get_fields array
function images_in_post($fields) {
	$num = 0;
	foreach ($fields as $key => $value) {
		// If it is an image field and there is an image object stored
		if(substr( $key, 0, 6 ) === "image_" && is_array($value)) {
			$num++;
		}
	}
	return $num;
}
