Rewritten image resizing for new config