javascript replaces image gallery