If you decide you do want to swap, you would need to be at least 2-3 mo into your intern year before you go to your prelim year PD to explore options. Just figure out where you match first and see how you like IM as a resident first before going too far down this rabbit hole. Your change of heart may be completely legit, but it just does no good to make a plan until you even know where your starting point is.