optimize background-image assignment

colorWithPatternImage is highly memory consuming, I changed the code by setting the 'contents' property of CALayer directly, and added a new property called "background-image-pattern" for the original usage.