Update gallery to remove index offset php warning

In debug mode my logs were filling with these errors when visiting the home page for the gallery app:

    {"app":"PHP","message":"Undefined offset: 1 at ...\apps\\gallery\\ajax\\gallery.php#12","level":2,"time":1374062637}

Not a major issue, but this fix helps keep the log files clean