Pagination code

software development

#1

hi
i am using this paginate code with another code, it should count 20 images on page, page 1 and 2 works, but i cant get to next images, in this gallery is 45 images, only gets 40 images…? i cant get more images up.
http://www.koddinn.com/myndir/album/born/
see links below Fyrri - Næsta

whats wrong here “Note” pagination code is included in this code

<?php global $plugin_path; $c = $_GET['count'];if( $c == null ) $c = 20; $o = $_GET['offset'];if( $o == null ) $o = 0; $images = fim_query_images($_GET['album'],$o,$c); $albumname = fim_get_cat_name_($_GET['album']); $fim .= "
"; $folder = get_bloginfo('wpurl')."/wp-content/fgallery/".fim_get_folder($_GET['album']); $f = substr(fim_get_folder($_GET['album']),0 ,-1 ); $lightbox = get_option('fim_use_lightbox'); $fim .= fim_build_navigation(fim_get_cat_name_($_GET['album'])); $tw = (20+get_option('fim_th_size'))."px"; if(get_option('fim_show_caption') == 'true'){ $th = (40+get_option('fim_th_size'))."px"; } } $fim .= "
"; $fim .= "

"; if( $o > 0 ) $o = $o - $c; if( $o < 0 ) $o = 0; $fim .= "< Fyrri síða "; $fim .="Næsta síða >"; $fim .="

"; $fim .= "

".__(' ', 'fgallery')."

"; $fim .= ""; return $fim; } // Get all images within a certain gallery function fim_query_images($catid,$offset=0, $rowcount=0) { global $wpdb, $table_prefix; $table_image = $table_prefix."fim_images"; $order_by = get_option('fim_image_order'); $order_type = get_option('fim_image_order_type'); if( $rowcount > 0 ) return $wpdb->get_results("SELECT * FROM $table_image WHERE cat = '$catid' AND status <> 'exclude' ORDER BY '$order_by' $order_type LIMIT $offset,$rowcount"); else return $wpdb->get_results("SELECT * FROM $table_image WHERE cat = '$catid' AND status <> 'exclude' ORDER BY '$order_by' $order_type"); hope you understand what i mean,