Use createPatternFromImage rather than createPattern

createPattern only handles videos and canvases. createPatternFromImage handles image -> pattern
conversions.