Implement changes by pomartel to allow image resize