Adds first test for image and refactors method + some cleanup