Fix resize check and reset in image plugin