Reverted some changes to image handling that weren't working as intended