There are no easy APIs for you to do that with in Rockbox.
For JPEG decoding, there is code in the standalone JPEG viewer plugin, but nowhere else. Ideally you would move the JPEG code out of that viewer into a library, rewrite the viewer plugin to use that library, and then you could also use that code in your plugin...
For MP3 playback, you would need to use Rockbox's core playback engine. I don't think anyone has done this before, so this is an opportunity for you to be ground-breaking...
Those probably weren't the answers you were looking for though.