Fixed a jfifremove infinte loop bug

Fixed a bug where a newline could interfere with jfifremove's substitution.  I don't know how this bug escaped so long - I'd been running this code for six months with no problems.  I also added a break out of the loop if there are any other similar errors.