fixes gallery main image and gallery main image form alternation