gallery init, submitting files, file validation and fixing urls