Ported image.py to core

Bug: 57322
Change-Id: I9e63adb52888477eded82d34839c5885be96e8b8
Merge "Ported image.py to core"