Fixed the code for alternate user.
For file profile-picture.php
at line 19 change
add_action('show_user_profile', 'add_userpic_fields');
to
add_action('show_user_profile', 'add_userpic_fields');
add_action('edit_user_profile', 'add_userpic_fields');
For function add_userpic_fields (now on line 80)
change
global $user_ID, $image_extensions;
to
global $user_ID, $user_id, $image_extensions;
$user_to_show = $user_ID;
if(!empty($user_id))
$user_to_show = $user_id;
and change (on what is now line 115)
<img src="<?php _e(author_image_path($user_ID)); ?>" width="150" /></label>
to
<img src="<?php _e(author_image_path($user_to_show)); ?>" width="150" /></label>
For function upload_pic (now on line 123)
change
global $image_dir, $user_ID, $image_extensions;
to
global $image_dir, $user_ID, $image_extensions, $user_id;
$user_to_edit = $user_ID;
if ( !empty($user_id) && current_user_can('edit_user', $user_id) )
$user_to_edit = $user_id;
and change (now line 136)
$old_pic_path = clean_path(ABSPATH . '/' . $image_dir . '/' . $user_ID . '.' . $image_extension);
to
$old_pic_path = clean_path(ABSPATH . '/' . $image_dir . '/' . $user_to_edit . '.' . $image_extension);
and change (now line 144)
$file_path = clean_path(ABSPATH . '/' . $image_dir . '/' . $user_ID . '.' . $file_ext);
to
$file_path = clean_path(ABSPATH . '/' . $image_dir . '/' . $user_to_edit . '.' . $file_ext);