Moved image gallery js into its own file and refactored.