Fix gallery plugin crash. Use correct loop variable name.
Merge pull request #296 from bjornhol/master

Fix gallery plugin crash. Use correct loop variable name.