Tidying up the gallery template