Bugfixes for image processing issues