Add function to get image format