Update includes/utilities.inc

Split the extraction of dimensions out into a separate function.