In the situation you are in, and since the child is only 2.5 years old, there is every possibility of your getting the custody, despite your affair with another person. However, (1) has the mutual consent divorce petition been filed in court? If not, you may file a contested divorce petition yourself on grounds of desertion and cruelty; Along with the divorce petition, you may also file an application for custody of your child; (2) does the photos/video show any intimate relationship? If not, it may be difficult to prove adultery charge against you. (3) if the mutual petition has been filed, you may not appear in court on the second motion, which will have the effect of such petition being dismissed. (4) apart from the divorce petition, you may also file an application under the Domestic Violence Act (as suggested by Mr. Sethi).