Added empty images array handling