Loads the an image of the given format from a memory block. The format
string is the image format file extension without a leading dot character.
An exception is raised on error.
Loads an image from resource file 'resource', if it's not null and of a
supported image format. The filename of 'resource' will be used to
determine the file format. If an image can't beloaded then null will be
returned.