modify img crop function