added code that will receive the images correctly.