Update rddt_pimg.py

Simplifying the url extension logic (not best, but maybe better).
Merged in brian's pull request, clearer representation of parsing the url_extension