Added function for registering images