Image scaling + bugfixes