added image type support

Added support for multiple imagetypes. Not just jpg.