fixing bug for gallery theme2