last/first bugfix
gallery quantities bugfix