I don't help you because I'm newbie in php and in this forum. But it seems that someone in net like to find any gallery builded on 4Image and hacked them. Two month ago I lost everything from my good working 4Images gallery. It shown how easy is hack this gallery. I would be grateful to skill people here help us how to securite our sites from such attack.