Change some functions to access vars from addon preferences.
Use internal mechanism to create new image.

Keep older, ImageMagick-dependent one for now.