Build correct path on image upload when config has custom content path

closes #2563
- build path relative to imagesPath (which contains the custom content path)
  instead of appRoot
- added test for custom content path
- added logic to tests for Windows url building to handle cases where Windows
  functionality is being tested on a unix operating system