Gallery program tidy up