Improve file name parsing

This patch improves parsing for images that do not have an extension. Without this patch the infix would be added to the domain, e.g. `www.example_2x.com/someFileWithoutExtension`. This patch changes it to append the infix to the full domain instead for such urls, e.g. `www.example.com/someFileWithoutExtension_2x`.