Add custom user image field on private messages list instead of default user picture ok, this is what I have done so far but it is still not working. 

First I wanted to add senders profile picture to the private message list on each user profile page. To accomplish that, I used the following code from drupal.org forum:

https://drupal.org/node/1549540#comment-5956560

It does work on my site, but it is using the default user picture. I would like to use a different image for users profile page. So I created an image field named profile_image. I am not pretty sure what is the best approach. On this page, they are trying to change the default user profile picture by the image field but for some reason it is not working for me:

How can I display a picture from a field as the user picture rather than the drupal default with user-picture.tpl.php?

I took the user-picture-tpl.php which had the following code: 

&lt;?php if ($user_picture): ?&gt;
  &lt;div class="user-picture"&gt;
    &lt;?php print $user_picture; ?&gt;
  &lt;/div&gt;
&lt;?php endif; ?&gt;


I removed it and add this code:

&lt;?php if (!empty($user-&gt;profile_image[LANGUAGE_NONE][0]['fid'])) {
  // Load the file
  $file = file_load($user-&gt;profile_image[LANGUAGE_NONE][0]['fid']);

  $account = user_load($account-&gt;uid);

  // Note the style name is "profile_picture" as explained in your question,
  // not "profile_pic" which was in your original code
  echo theme('image_style', array('style_name' =&gt; 'people_profile_image', 'path' =&gt; $file-&gt;uri));
}


Nothing is working yet. what I am doing wrong? could you please help me?

Thanks
You have made mistake in your field name, Drupal creates an machine name of any field prefixed as "field_" if you create it using Field UI. Using thumbnail as the style and also ensure that the style you have added -- people_profile_image is created in the Image Styles

so your code should be 

if (!empty($user-&gt;field_profile_image[LANGUAGE_NONE][0]['fid'])) {
  // Load the file
  $file = file_load($user-&gt;field_profile_image[LANGUAGE_NONE][0]['fid']);
  $account = user_load($user-&gt;uid);

  // Note the style name is "thumbnail" and that your field name is
  // field_profile_image not profile_image which you have put in second line
  // which loads the file
  echo theme('image_style', array('style_name' =&gt; 'thumbnail', 'path' =&gt; $file-&gt;uri));
}