Properly format gallery urls