portability fixes for imgedit project