Next/previous a-like single navigation

After some additional research it looks like it will require to use two separate methods to get next/previous page/post to work.

More here,here and here

Solution for pages:

    <?php
$pagelist = get_pages('sort_column=menu_order&sort_order=asc');
$pages = array();
foreach ($pagelist as $page) {
   $pages[] += $page->ID;
}

$current = array_search(get_the_ID(), $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];
?>

<div class="navigation">
<?php if (!empty($prevID)) { ?>
<div class="alignleft">
<a href="https://wordpress.stackexchange.com/questions/144443/<?php echo get_permalink($prevID); ?>"><img src="https://wordpress.stackexchange.com/questions/144443/arrow-left.png"></a>
</div>
<?php }
if (!empty($nextID)) { ?>
<div class="alignright">
<a href="<?php echo get_permalink($nextID); ?>"><img src="arrow-right.png"></a>
</div>
<?php } ?>
</div><!-- .navigation -->

solution for posts

<?php previous_post(' %', '<img src="https://wordpress.stackexchange.com/questions/144443/arrow-left.png" alt="Next" border="0" align="right" />', 'no'); ?>
<?php next_post(' %', '<img src="arrow-right.png" alt="Next" border="0" align="right" />', 'no'); ?>