Photo gallery code redone