fixes background and gallery JS