added support for other image types
added support for other image types - NOT TESTED!