Img improvements

I'll try to split up my patches. Just remember the first PR will have to be merged last and after I rebase it as soon as the other PRs are merged.