Pure JavaScript image gallery