A new version of the MHD_NX code, that computes the ideal MHD stability of helically symmetric equilibria with arbitrary topology of magnetic surfaces, was applied to the investigation of equilibrium magnetic islands in tokamak-like conditions. Any helical deformation of the plasma boundary shape from a circular cylinder results in the breaking of topology of the helical flux level lines and appearance of magnetic islands at the place of the magnetic surface q = m/n in the original large aspect ratio tokamak equilibrium, provided that the helical pitch is the same for the equilibrium and magnetic lines at the resonant surface. A solution family of the generalized Grad-Shafranov equation with a linear dependence of the source current density on the helical flux was employed to compute equilibria with various chains of islands. Internal ideal MHD modes resonant to the corresponding island chain (longitudinal wave number nh = 0 in the helical coordinates) are found to be robustly unstable for m = 1 and m = 2 boundary deformations, while stable for higher plasma shape poloidal harmonics m ≥ 3.