fixed Image class with different image formats