In order to use the image selection only in the admin panel, and use the selected value in the template, and not the image link
function format_value($value, $post_id, $field)
{
// bail early if no value
if( empty($value) ) {
return $value;
}
// get value
$retvalue['value'] = $value;
$retvalue['image'] = $field['image_path'] . esc_attr($value) . '.'.$field['image_extension'];
// format value
// return value
return $retvalue;
}