Adding image styles path in page.tpl i have image upload field in my theme-settings.php

$form['fsos_settings']['intro']['hero']['heroImage'] = array(
    '#type' =&gt; 'managed_file',
    '#upload_validators' =&gt; array(
    'file_validate_extensions' =&gt; array(0 =&gt; 'png jpg jpeg gif'),
),
    '#upload_location' =&gt; 'public://image/home/',
    '#description' =&gt; t("Upload an image."),
    '#default_value' =&gt; theme_get_setting('heroImage'),
);


I can print this in my page.tpl.php using the following code

&lt;img src="&lt;?php print file_create_url(file_load(theme_get_setting('heroImage'))-&gt;uri); ?&gt;"/&gt;


But i want to use Image Styles (heroimage) for the size. How can i get the image styles URL instead of the original URL
Heres an example using theme_image_style() 

$mypath = (file_load(theme_get_setting('heroImage'))-&gt;uri);
print theme_image_style(
  array(
    'style_name' =&gt; 'heroimage',
    'path' =&gt; $mypath,
    'attributes' =&gt; array(
    'class' =&gt; 'YOUR_IMAGE_CLASS'
    ),
    'width' =&gt; NULL,
    'height' =&gt; NULL,
   )
 );
}


I'll be honest, I cant remember why I set height and width to NULL, off the top of my head it helped fix some bug! Hope it helps!