split resize method, add method to determin average colour