refactored ImageRec