how to check if the image field is empty or have uploaded image? &lt;?php
  $nid = arg(1);
  $path = arg(0);
  $node = node_load($nid);
  if(isset($nid) &amp;&amp; is_numeric($nid) &amp;&amp; isset($path) &amp;&amp; $path == 'node' &amp;&amp; isset($node) &amp;&amp; $node-&gt;type == 'page') {
    $theme_img = file_create_url($node-&gt;field_page_cover_image[$node-&gt;language][0]['uri']); //origional image path
    if($theme_img) {
        //image having style
        print theme('image_style', array('path' =&gt; $node-&gt;field_page_cover_image[$node-&gt;language][0]['uri'], 'style_name' =&gt; 'page_theme'));
    }
   }
?&gt;


I've loaded the above code in page.tpl.php. It is to load the uploaded styled image from individual pages. 
I am getting error in line no. 6 ($theme_img), for pages which have empty image field. It is working fine in pages which have image uploaded. How to know if this field is empty or have image uploaded.
Try this:

if ($node = menu_get_object('node')) {

  // Set default language if not set
  $node-&gt;language = isset($node-&gt;language) ? $node-&gt;language : LANGUAGE_NONE;

  if ($node-&gt;type == 'page' &amp;&amp; isset($node-&gt;field_page_cover_image[$node-&gt;language][0]['uri'])) {
    print theme('image_style', 
            array('path' =&gt; $node-&gt;field_page_cover_image[$node-&gt;language][0]['uri'], 
                  'style_name' =&gt; 'page_theme'));
  }

}


Odd you're printing out the image though, must be in a tpl file. I'd suggest moving the code logic to a hook_preprocess_node and setting a template variable instead.

e.g:

/**
 * Implements hook_preprocess_node
 */
function MYTHEME_preprocess_node($variables){

  $node =&amp; $variables['node']; // by reference
  // Set default language if not set
  $node-&gt;language = isset($node-&gt;language) ? $node-&gt;language : LANGUAGE_NONE;

  if ($node-&gt;type == 'page' &amp;&amp; isset($node-&gt;field_page_cover_image[$node-&gt;language][0]['uri'])) {
    // Add new template variable called $page_theme_image
    $variables['page_theme_image'] = theme('image_style', 
            array('path' =&gt; $node-&gt;field_page_cover_image[$node-&gt;language][0]['uri'], 
                  'style_name' =&gt; 'page_theme'));
  }

}


and then in your tpl.php file, you just go:

if (!empty($page_theme_image)) {
  print $page_theme_image;
}