Silently ignore empty lines that do not contain errors
Move image loading/writing code into r_imagelib* + refactoring