TMI-ICNS: Added debug for sips command.
TMI-JPEG: Simplified logic.
TMI-JPEG: Refactorings for better separation.