[DF-4991] Fixed image format detection