optimize images + some minor changes to js