actually after doing a little more research I found that the link is MORE dynamic than I thought. I need to match anything after page.com/files\d+... until after the .jpg . No other part of the page has /files\d+ so if it finds a match, it'll always be the right one. Can someone help with this?
In this last part of your regexp the dot-plus will match all up to the end of line. The remaining '.jpg' part will not be found and therefore the regexp never matches.
The solution is to make the dot-plus part of the regexp less greedy, change the part above to: