By using this tutorial http://blog.urbaninsight.com/2011/09/12/adding-pager-navigation-nodes-drupal-7 I have created next/prev buttons for my images.
But as I have a lot of galleries and I need to filter images not only by node type but also by node reference field value.
The machine name of my field is
field_pers_gallery and in phpmyadmin it is assigned to a particular gallery by
I'm note good at creating db query, could anybody help with any advices?