added some image magic stuff