Improved resize functionality

This makes it a lot easier to resize images used by other apps than the built in image element (e.g. images from drvideo).

Should not break compatibilty with existing API and functionality.