add return statements and fix gallery test