Hi Kaveri,
You need to create an entity in your domain model to store the image in, instead of using an attribute. You can associate this entity to your existing entity if needed. You can find a step by step tutorial in the documentation: https://docs.mendix.com/howto/data-models/working-with-images-and-files.
Hope this helps!