Update image resize JavaScript