Develop jquery for slide and photos, and refactor code