How to resize and compress JPGs inside SVGs?

Hey, I’m using user avatars in SVG images, and the files are not compressed and are somewhat large and uncompressed.

Are there any plugins that would compress and reduce the size of that image to an optimal resolution based on the frame it’s inserted in? Eg: If I place an image 500px wide inside a frame that is 100px wide using the fill, how can I reduce this image later while exporting my SVG composition?

Thanks in advance!