changed chmods on js files; fixed bug at gallery model; improved file loading