Standalone Image tests

This PR removes the usage of `JPATH_TESTS` for the output directory, and replaces it with `__DIR__`.