Gallery pro bug

Thank you for your replay.
This does work but I would like to use the " gallaryItems" variable as a global variable so I can use it in multiple functions. Is that posible?