adds total images method to gallery model