Format input of format_data to handle 2-D arrays (single images).