more fixes for ifs and the gallery