@imadullakhan
1. You can simply override the functionality by using the Image Core component or Text Core component.
- /apps/core/wcm/components/image/v2/image
- /apps/core/wcm/components/text/v2/text
2. create one component names text-image by using
- sling:resourceSuperType: core/wcm/components/image/v2/image or using
- sling:resourceSuperType: core/wcm/components/text/v2/text
3. Add your custom option just to set the image alignment.
4. Add some CSS that will align the Image-based left/right selected option in cq:dialog.
5. Now copy-paste the HTML code snippet into text-image.html from selected Sling resource type and updated your logic based on selected properties and CSS class.
Please let me know if you need any help on this.