Move image resizing to UIImage category to prevent memory errors