RewriteMap can’t go in htaccess files. I’m guessing that’s what’s causing the 500 error. Normally I’d say you should move the RewriteMap to the main server config file (httpd.conf) but you don’t seem to be using “lc” at all so far, so you can probably just delete that line.
Ditto J_M’s comments on RewriteMap. It’s a very useful tool but, because it can disable a server, its use is limited to the httpd.conf or httpd-vhosts.conf files.
As for your your RewriteCond statement, it, too, is incorrect. Just delete it and you’ll be okay (%{REQUEST_URI} will already contain the .JPG file extension).
As for using the EVERYTHING atom, you’re allowing a URI of simply .JPG. (no filename). Change the * to + to require at least one character.