Fixed URL checking

URL checking used to filter out any URL with ".jpg" in the name. Updated so as to filter out only files ending in ".jpg" (after post data and trailing slashes stripped off). 

Fixes #47 part 1.