cleaned up get_images method