Many of us use social media as it can be beneficial in spreading Islam in addition to keeping in contact with those we know from friends and family.
Unfortunately on all platforms such as Facebook and YouTube, corruption may pop up from ads. If one unintentionally sees these types of things, then it is upon him to look away. If one would deliberately look at corrupt things whilst fasting, then it would of course decrease his reward but not break the fast.
Please watch a recent lecture I gave regarding this topic:
As for ghusl, this wouldn’t be needed unless you ejaculate. So if you see a haram picture by mistake and then you automatically ejaculate (which isn’t a common thing) then you would have to perform the ghusl of janabah.
May Allah grant you success