Sanjay,
The extent of the map is not always that value, it’s just an example, If you know your .jpg file represents which extent, you can set the corresponding value, for example, your image represent India boundary, you can set the India extent. Raster layer is not like feature layer which can get extent by itself, you can ask the image provider to give you the extent or corresponding world file.
I think the out of memory problem may cause by the incorrect code, such as, you didn’t close your raster layer before remove it from map control.
The projection is not required for .jpg file.
Let me know if you have more questions.
Thanks,
James