Added function to clip image