fixed bug that was breaking images and added more logging